Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
| index f5e408a34a3f2a485992c6b610312bb6424b4d14..7e444f46104d2b86c3d4589c89641e4091daf12f 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -104,6 +104,7 @@ |
| #include "chrome/installer/util/google_update_settings.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/common/content_client.h" |
| +#include "content/public/common/content_switches.h" |
| #include "content/public/common/main_function_params.h" |
| #include "grit/app_locale_settings.h" |
| #include "grit/browser_resources.h" |
| @@ -419,6 +420,29 @@ bool HasImportSwitch(const CommandLine& command_line) { |
| command_line.HasSwitch(switches::kImportFromFile)); |
| } |
| +void LaunchDevToolsHandlerIfNeeded(Profile* profile, |
| + const CommandLine& command_line) { |
| + if (command_line.HasSwitch(::switches::kRemoteDebuggingPort)) { |
| + std::string port_str = |
| + command_line.GetSwitchValueASCII(::switches::kRemoteDebuggingPort); |
| + int port; |
| + if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { |
| + std::string frontend_str; |
| + if (command_line.HasSwitch(::switches::kRemoteDebuggingFrontend)) { |
| + frontend_str = command_line.GetSwitchValueASCII( |
| + ::switches::kRemoteDebuggingFrontend); |
| + } |
| + g_browser_process->CreateDevToolsHttpProtocolHandler( |
| + profile, |
| + "127.0.0.1", |
| + port, |
| + frontend_str); |
| + } else { |
| + DLOG(WARNING) << "Invalid http debugger port number " << port; |
| + } |
| + } |
| +} |
| + |
| #if defined(ENABLE_RLZ) |
| bool IsGoogleUrl(const GURL& url) { |
| return google_util::IsGoogleHomePageUrl(url.possibly_invalid_spec()); |
| @@ -861,6 +885,7 @@ void ChromeBrowserMainParts::PreProfileInit() { |
| } |
| void ChromeBrowserMainParts::PostProfileInit() { |
| + LaunchDevToolsHandlerIfNeeded(profile(), parsed_command_line()); |
|
Nikita (slow)
2012/12/05 14:06:04
This part isn't reached on ChromeOS build.
#0 ch
stevenjb
2012/12/05 17:35:23
Yikes! Good thing that (until now) PostProfileInit
|
| for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
| chrome_extra_parts_[i]->PostProfileInit(); |
| } |