| 76 | |
| 77 | |
| 78 | bool 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 | |
| 112 | void ContextMenuHandler::OnContextMenuDismissed(CefRefPtr<CefBrowser> browser, |
nothing calls this directly
no test coverage detected