MCPcopy Create free account
hub / github.com/cztomczak/cefpython / OnContextMenuCommand

Method OnContextMenuCommand

src/client_handler/context_menu_handler.cpp:78–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78bool ContextMenuHandler::OnContextMenuCommand(
79 CefRefPtr<CefBrowser> browser,
80 CefRefPtr<CefFrame> frame,
81 CefRefPtr<CefContextMenuParams> params,
82 int command_id,
83 EventFlags event_flags)
84{
85 if (command_id == _MENU_ID_OPEN_PAGE_IN_EXTERNAL_BROWSER) {
86 #if defined(OS_WIN)
87 ShellExecuteA(0, "open", params->GetPageUrl().ToString().c_str(),
88 0, 0, SW_SHOWNORMAL);
89 #elif defined(OS_LINUX)
90 OpenInExternalBrowser(params->GetPageUrl().ToString());
91 #endif // OS_WIN
92 return true;
93 } else if (command_id == _MENU_ID_OPEN_FRAME_IN_EXTERNAL_BROWSER) {
94 #if defined(OS_WIN)
95 ShellExecuteA(0, "open", params->GetFrameUrl().ToString().c_str(),
96 0, 0, SW_SHOWNORMAL);
97 #elif defined(OS_LINUX)
98 OpenInExternalBrowser(params->GetFrameUrl().ToString());
99 #endif // OS_WIN
100 return true;
101 } else if (command_id == _MENU_ID_RELOAD_PAGE) {
102 browser->ReloadIgnoreCache();
103 return true;
104 } else if (command_id == _MENU_ID_DEVTOOLS) {
105 PyBrowser_ShowDevTools(browser);
106 return true;
107 }
108 return false;
109}
110
111
112void ContextMenuHandler::OnContextMenuDismissed(CefRefPtr<CefBrowser> browser,

Callers

nothing calls this directly

Calls 3

OpenInExternalBrowserFunction · 0.85
c_strMethod · 0.80
ToStringMethod · 0.80

Tested by

no test coverage detected