Chromium Code Reviews| Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
| diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
| index 9b15ebaee3aee778856ea22437f4f015fda3fefe..a03055af3416f0c0f4a3ddd626d041eb4d5f5c1f 100644 |
| --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
| +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
| @@ -329,6 +329,7 @@ StartupBrowserCreatorImpl::StartupBrowserCreatorImpl( |
| StartupBrowserCreatorImpl::~StartupBrowserCreatorImpl() { |
| } |
| + |
|
sky
2012/12/04 00:10:53
remove newline.
zel
2012/12/04 02:12:28
Done.
|
| bool StartupBrowserCreatorImpl::Launch(Profile* profile, |
| const std::vector<GURL>& urls_to_open, |
| bool process_startup) { |
| @@ -345,25 +346,9 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile, |
| if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit)) |
| base::StatisticsRecorder::set_dump_on_exit(true); |
| - if (command_line_.HasSwitch(switches::kRemoteDebuggingPort)) { |
| - std::string port_str = |
| - command_line_.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
| - int64 port; |
| - if (base::StringToInt64(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", |
| - static_cast<int>(port), |
| - frontend_str); |
| - } else { |
| - DLOG(WARNING) << "Invalid http debugger port number " << port; |
| - } |
| - } |
| +#if !defined(OS_CHROMEOS) |
| + LaunchDevToolsHandlerIfNeeded(profile, command_line_); |
| +#endif |
| #if defined(ENABLE_APP_LIST) |
| app_list_controller::CheckAppListTaskbarShortcut(); |
| @@ -1053,6 +1038,29 @@ void StartupBrowserCreatorImpl::CheckPreferencesBackup(Profile* profile) { |
| } |
| } |
| +void StartupBrowserCreatorImpl::LaunchDevToolsHandlerIfNeeded( |
| + Profile* profile, const CommandLine& command_line) { |
|
sky
2012/12/04 00:10:53
wrap command_line to new line.
|
| + if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { |
|
sky
2012/12/04 00:10:53
Refactor this so you don't duplicate it.
zel
2012/12/04 00:38:47
Yeah, that's what I wanted to ping you about - whe
sky
2012/12/04 01:22:45
If there is a directory for devtools stuff I would
zel
2012/12/04 02:12:28
Moved to chrome_browser_main.cc... invoked from Ch
|
| + std::string port_str = |
| + command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
| + int64 port; |
| + if (base::StringToInt64(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", |
| + static_cast<int>(port), |
| + frontend_str); |
| + } else { |
| + DLOG(WARNING) << "Invalid http debugger port number " << port; |
| + } |
| + } |
| +} |
| + |
| #if !defined(OS_WIN) || defined(USE_AURA) |
| // static |
| bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |