| Index: chrome/browser/browser.cc
|
| ===================================================================
|
| --- chrome/browser/browser.cc (revision 12273)
|
| +++ chrome/browser/browser.cc (working copy)
|
| @@ -16,6 +16,7 @@
|
| #include "chrome/browser/browser_window.h"
|
| #include "chrome/browser/character_encoding.h"
|
| #include "chrome/browser/debugger/devtools_manager.h"
|
| +#include "chrome/browser/debugger/devtools_window.h"
|
| #include "chrome/browser/location_bar.h"
|
| #include "chrome/browser/metrics/user_metrics.h"
|
| #include "chrome/browser/net/url_fixer_upper.h"
|
| @@ -941,11 +942,19 @@
|
| #ifndef CHROME_DEBUGGER_DISABLED
|
| UserMetrics::RecordAction(L"Debugger", profile_);
|
| TabContents* current_tab = GetSelectedTabContents();
|
| - if (current_tab->AsWebContents()) {
|
| + WebContents* wc = current_tab->AsWebContents();
|
| + if (wc) {
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kEnableOutOfProcessDevTools)) {
|
| - WebContents* wc = current_tab->AsWebContents();
|
| - g_browser_process->devtools_manager()->ShowDevToolsForWebContents(wc);
|
| + DevToolsManager* manager = g_browser_process->devtools_manager();
|
| + DevToolsClientHost* host = manager->GetDevToolsClientHostFor(*wc);
|
| + if (!host) {
|
| + host = DevToolsWindow::Create();
|
| + manager->RegisterDevToolsClientHostFor(*wc, host);
|
| + }
|
| + DevToolsWindow* window = host->AsDevToolsWindow();
|
| + if (window)
|
| + window->Show();
|
| } else {
|
| // Only one debugger instance can exist at a time right now.
|
| // TODO(erikkay): need an alert, dialog, something
|
|
|