Commit 86d3aca4 authored by zelidrag@chromium.org's avatar zelidrag@chromium.org

Moved dev tools initialization bit earlier for ChromeOS browser start.

We need to launch DevTools before WebUI for login screen is up and running so we can attach remotely do run automation tasks there. 

BUG=162730
TEST=make sure you can connect to devtools when ChromeOS is camping on the login/OOBE screen


Review URL: https://chromiumcodereview.appspot.com/11412281

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171052 0039d316-1c4b-4281-b951-d872f2087c98
parent b9ab6d54
......@@ -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());
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostProfileInit();
}
......
......@@ -345,26 +345,6 @@ 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(ENABLE_APP_LIST)
app_list_controller::CheckAppListTaskbarShortcut();
if (command_line_.HasSwitch(switches::kShowAppList)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment