mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Update to Chromium revision 136953.
- Add chrome-devtools scheme handler implementation. - Change the CefBrowser::GetDevToolsURL() method to allow retrieval of both http and chrome-devtools URLs. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@630 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -94,6 +94,12 @@ void ClientHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser) {
|
||||
if (m_BrowserId == browser->GetIdentifier()) {
|
||||
// Free the browser pointer so that the browser can be destroyed
|
||||
m_Browser = NULL;
|
||||
} else if (browser->IsPopup()) {
|
||||
// Remove the record for DevTools popup windows.
|
||||
std::set<std::string>::iterator it =
|
||||
m_OpenDevToolsURLs.find(browser->GetMainFrame()->GetURL());
|
||||
if (it != m_OpenDevToolsURLs.end())
|
||||
m_OpenDevToolsURLs.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,9 +268,11 @@ void ClientHandler::OnBeforeContextMenu(
|
||||
// Add a "Show DevTools" item to all context menus.
|
||||
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
|
||||
|
||||
CefString devtools_url = browser->GetHost()->GetDevToolsURL();
|
||||
if (devtools_url.empty()) {
|
||||
// Disable the menu option if DevTools aren't enabled.
|
||||
CefString devtools_url = browser->GetHost()->GetDevToolsURL(true);
|
||||
if (devtools_url.empty() ||
|
||||
m_OpenDevToolsURLs.find(devtools_url) != m_OpenDevToolsURLs.end()) {
|
||||
// Disable the menu option if DevTools isn't enabled or if a window is
|
||||
// already open for the current URL.
|
||||
model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false);
|
||||
}
|
||||
|
||||
@@ -325,8 +333,10 @@ std::string ClientHandler::GetLastDownloadFile() {
|
||||
}
|
||||
|
||||
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser) {
|
||||
std::string devtools_url = browser->GetHost()->GetDevToolsURL();
|
||||
if (!devtools_url.empty()) {
|
||||
std::string devtools_url = browser->GetHost()->GetDevToolsURL(true);
|
||||
if (!devtools_url.empty() &&
|
||||
m_OpenDevToolsURLs.find(devtools_url) == m_OpenDevToolsURLs.end()) {
|
||||
m_OpenDevToolsURLs.insert(devtools_url);
|
||||
browser->GetMainFrame()->ExecuteJavaScript(
|
||||
"window.open('" + devtools_url + "');", "about:blank", 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user