mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Update to Chromium revision 133962.
- Mac: Fix path discovery for non-native frameworks (issue #576). - Avoid loading Chrome-specific pack files (issue #578). - Make DevTools remote debugging URLs harder to guess (issue #583) - Add CefBrowser::GetDevToolsURL() method (issue #583). - Add DevTools example to cefclient (must run with --remote-debugging-port=XXXX command-line flag) (issue #583). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@608 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -251,8 +251,11 @@ void ClientHandler::OnBeforeContextMenu(
|
||||
// Add a "Show DevTools" item to all context menus.
|
||||
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
|
||||
|
||||
// TODO(cef): Enable once ShowDevTools() is implemented.
|
||||
model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false);
|
||||
CefString devtools_url = browser->GetHost()->GetDevToolsURL();
|
||||
if (devtools_url.empty()) {
|
||||
// Disable the menu option if DevTools aren't enabled.
|
||||
model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false);
|
||||
}
|
||||
|
||||
// Test context menu features.
|
||||
BuildTestMenu(model);
|
||||
@@ -267,7 +270,7 @@ bool ClientHandler::OnContextMenuCommand(
|
||||
EventFlags event_flags) {
|
||||
switch (command_id) {
|
||||
case CLIENT_ID_SHOW_DEVTOOLS:
|
||||
ShowDevTools();
|
||||
ShowDevTools(browser);
|
||||
return true;
|
||||
default: // Allow default handling, if any.
|
||||
return ExecuteTestMenu(command_id);
|
||||
@@ -310,10 +313,12 @@ std::string ClientHandler::GetLastDownloadFile() {
|
||||
return m_LastDownloadFile;
|
||||
}
|
||||
|
||||
void ClientHandler::ShowDevTools() {
|
||||
}
|
||||
|
||||
void ClientHandler::CloseDevTools() {
|
||||
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser) {
|
||||
std::string devtools_url = browser->GetHost()->GetDevToolsURL();
|
||||
if (!devtools_url.empty()) {
|
||||
browser->GetMainFrame()->ExecuteJavaScript(
|
||||
"window.open('" + devtools_url + "');", "about:blank", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
|
Reference in New Issue
Block a user