mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add context menu support (issue #509):
- Add new CefContextMenuHandler, CefContextMenuParams and CefMenuModel classes. - Add cef_strings.grd and related infrastructure for supporting translation of CEF strings. - Generate include/cef_pack_resources.h and include/cef_pack_strings.h files at build time that include all IDs used by CEF pack files. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@595 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -24,7 +24,8 @@ class ClientHandler : public CefClient,
|
||||
public CefLoadHandler,
|
||||
public CefRequestHandler,
|
||||
public CefDisplayHandler,
|
||||
public CefGeolocationHandler {
|
||||
public CefGeolocationHandler,
|
||||
public CefContextMenuHandler {
|
||||
public:
|
||||
// Interface for process message delegates. Do not perform work in the
|
||||
// RenderDelegate constructor.
|
||||
@@ -81,6 +82,9 @@ class ClientHandler : public CefClient,
|
||||
virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() OVERRIDE {
|
||||
return this;
|
||||
}
|
||||
virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() OVERRIDE {
|
||||
return this;
|
||||
}
|
||||
virtual bool OnProcessMessageRecieved(CefRefPtr<CefBrowser> browser,
|
||||
CefProcessId source_process,
|
||||
CefRefPtr<CefProcessMessage> message)
|
||||
@@ -137,6 +141,17 @@ class ClientHandler : public CefClient,
|
||||
int request_id,
|
||||
CefRefPtr<CefGeolocationCallback> callback) OVERRIDE;
|
||||
|
||||
// CefContextMenuHandler methods
|
||||
virtual void OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefContextMenuParams> params,
|
||||
CefRefPtr<CefMenuModel> model) OVERRIDE;
|
||||
virtual bool OnContextMenuCommand(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefContextMenuParams> params,
|
||||
int command_id,
|
||||
EventFlags event_flags) OVERRIDE;
|
||||
|
||||
void SetMainHwnd(CefWindowHandle hwnd);
|
||||
CefWindowHandle GetMainHwnd() { return m_MainHwnd; }
|
||||
void SetEditHwnd(CefWindowHandle hwnd);
|
||||
@@ -177,6 +192,15 @@ class ClientHandler : public CefClient,
|
||||
// Create all of RequestDelegateSet objects.
|
||||
static void CreateRequestDelegates(RequestDelegateSet& delegates);
|
||||
|
||||
// Test context menu creation.
|
||||
void BuildTestMenu(CefRefPtr<CefMenuModel> model);
|
||||
bool ExecuteTestMenu(int command_id);
|
||||
struct TestMenuState {
|
||||
TestMenuState() : check_item(true), radio_item(0) {}
|
||||
bool check_item;
|
||||
int radio_item;
|
||||
} m_TestMenuState;
|
||||
|
||||
// The child browser window
|
||||
CefRefPtr<CefBrowser> m_Browser;
|
||||
|
||||
|
Reference in New Issue
Block a user