diff options
Diffstat (limited to 'chrome/browser/debugger/devtools_manager.cc')
-rw-r--r-- | chrome/browser/debugger/devtools_manager.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/debugger/devtools_manager.cc b/chrome/browser/debugger/devtools_manager.cc index d1a1da3..94d2868 100644 --- a/chrome/browser/debugger/devtools_manager.cc +++ b/chrome/browser/debugger/devtools_manager.cc @@ -7,6 +7,9 @@ #include "chrome/browser/debugger/devtools_window.h" #include "chrome/browser/debugger/devtools_client_host.h" #include "chrome/browser/renderer_host/render_view_host.h" +#include "chrome/browser/tab_contents/navigation_controller.h" +#include "chrome/browser/tab_contents/navigation_entry.h" +#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/devtools_messages.h" #include "googleurl/src/gurl.h" @@ -51,7 +54,7 @@ void DevToolsManager::ForwardToDevToolsAgent( if (!win) { continue; } - if (win->HasRenderViewHost(*client_rvh)) { + if (client_rvh == win->GetRenderViewHost()) { ForwardToDevToolsAgent(win, message); return; } @@ -89,6 +92,13 @@ void DevToolsManager::OpenDevToolsWindow(RenderViewHost* inspected_rvh) { host = DevToolsWindow::Create(); RegisterDevToolsClientHostFor(inspected_rvh, host); } + TabContents* tab_contents = inspected_rvh->delegate()->GetAsTabContents(); + if (tab_contents) { + NavigationEntry* entry = tab_contents->controller().GetActiveEntry(); + if (entry) { + host->SetInspectedTabUrl(entry->url().possibly_invalid_spec()); + } + } DevToolsWindow* window = host->AsDevToolsWindow(); if (window) window->Show(); |