diff options
-rw-r--r-- | chrome/browser/browser.cc | 18 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 4de2951..43e4a49 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -938,12 +938,18 @@ void Browser::OpenDebuggerWindow() { UserMetrics::RecordAction(L"Debugger", profile_); TabContents* current_tab = GetSelectedTabContents(); if (current_tab->AsWebContents()) { - // Only one debugger instance can exist at a time right now. - // TODO(erikkay): need an alert, dialog, something - // or better yet, fix the one instance limitation - if (!DebuggerWindow::DoesDebuggerExist()) - debugger_window_ = new DebuggerWindow(); - debugger_window_->Show(current_tab); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableOutOfProcessDevTools)) { + WebContents* wc = current_tab->AsWebContents(); + wc->view()->OpenDeveloperTools(); + } else { + // Only one debugger instance can exist at a time right now. + // TODO(erikkay): need an alert, dialog, something + // or better yet, fix the one instance limitation + if (!DebuggerWindow::DoesDebuggerExist()) + debugger_window_ = new DebuggerWindow(); + debugger_window_->Show(current_tab); + } } #endif } diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 00757ed..1ea18e8 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -404,4 +404,8 @@ const wchar_t kRendererCmdPrefix[] = L"renderer-cmd-prefix"; // can connect to a channel, provided it knows its name. For debugging purposes. const wchar_t kIPCUseFIFO[] = L"ipc-use-fifo"; +// If this flag is set open out of process developer tools window instead of +// Console Debugger when user clicks "Debug JavaScript". +const wchar_t kEnableOutOfProcessDevTools[] = L"enable-oop-devtools"; + } // namespace switches diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 0c4c2e5..f106dba 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -154,6 +154,8 @@ extern const wchar_t kRendererCmdPrefix[]; extern const wchar_t kIPCUseFIFO[]; +extern const wchar_t kEnableOutOfProcessDevTools[]; + } // namespace switches #endif // CHROME_COMMON_CHROME_SWITCHES_H__ |