Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 75.1.4+g4210896+chromium-75.0.3770.100
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

(default)
Class CefContextMenuHandler

CefBaseRefCounted
   |
   +--CefContextMenuHandler

   in cef_context_menu_handler.h

class CefContextMenuHandler
extends CefBaseRefCounted

Implement this interface to handle context menu events. The methods of this class will be called on the UI thread.


Inner Classes, Typedefs, and Enums
typedef CefContextMenuHandler::EventFlags
          
 
Method Summary
 virtual void OnBeforeContextMenu( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefContextMenuParams > params, CefRefPtr< CefMenuModel > model )
          Called before a context menu is displayed.
 virtual bool OnContextMenuCommand( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefContextMenuParams > params, int command_id, CefContextMenuHandler::EventFlags event_flags )
          Called to execute a command selected from the context menu.
 virtual void OnContextMenuDismissed( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame )
          Called when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.
 virtual bool RunContextMenu( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefContextMenuParams > params, CefRefPtr< CefMenuModel > model, CefRefPtr< CefRunContextMenuCallback > callback )
          Called to allow custom display of the context menu.
   
Methods inherited from class CefBaseRefCounted
AddRef, Release, HasOneRef, HasAtLeastOneRef
 

Method Detail

OnBeforeContextMenu

public virtual void OnBeforeContextMenu( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefContextMenuParams > params, CefRefPtr< CefMenuModel > model );
Called before a context menu is displayed. |params| provides information about the context menu state. |model| initially contains the default context menu. The |model| can be cleared to show no context menu or modified to show a custom menu. Do not keep references to |params| or |model| outside of this callback.

OnContextMenuCommand

public virtual bool OnContextMenuCommand( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefContextMenuParams > params, int command_id, CefContextMenuHandler::EventFlags event_flags );
Called to execute a command selected from the context menu. Return true if the command was handled or false for the default implementation. See cef_menu_id_t for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same values as what was passed to OnBeforeContextMenu(). Do not keep a reference to |params| outside of this callback.

OnContextMenuDismissed

public virtual void OnContextMenuDismissed( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame );
Called when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.

RunContextMenu

public virtual bool RunContextMenu( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefContextMenuParams > params, CefRefPtr< CefMenuModel > model, CefRefPtr< CefRunContextMenuCallback > callback );
Called to allow custom display of the context menu. |params| provides information about the context menu state. |model| contains the context menu model resulting from OnBeforeContextMenu. For custom display return true and execute |callback| either synchronously or asynchronously with the selected command ID. For default display return false. Do not keep references to |params| or |model| outside of this callback.

 Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 75.1.4+g4210896+chromium-75.0.3770.100
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt