Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 11412281: Moved dev tools initialization bit earlier for ChromeOS browser start. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index fcbddc3ea35630369ac1ec2f63475185ffae85b2..accdb24bb81502fcc35f06d7109b5df26345b131 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -86,6 +86,7 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/power/power_state_override.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "grit/platform_locale_settings.h"
#include "net/base/network_change_notifier.h"
@@ -169,6 +170,29 @@ class StubLogin : public LoginStatusConsumer,
bool profile_prepared_;
};
+void LaunchDevToolsHandlerIfNeeded(Profile* profile,
+ const CommandLine& command_line) {
+ 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) {
sky 2012/12/04 00:10:53 Use StringToInt (avoids cast on 188).
zel 2012/12/04 02:12:28 Done.
+ 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;
+ }
+ }
+}
+
void OptionallyRunChromeOSLoginManager(const CommandLine& parsed_command_line,
Profile* profile) {
if (parsed_command_line.HasSwitch(::switches::kLoginManager)) {
@@ -503,11 +527,15 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
// configuration before login.
connector->GetNetworkConfigurationUpdater();
- // Make sure that wallpaper boot transition and other delays in OOBE
- // are disabled for tests by default.
- // Individual tests may enable them if they want.
- if (parsed_command_line().HasSwitch(::switches::kTestType))
+ if (parsed_command_line().HasSwitch(::switches::kTestType)) {
+ // Make sure that wallpaper boot transition and other delays in OOBE
+ // are disabled for tests by default.
+ // Individual tests may enable them if they want.
WizardController::SetZeroDelays();
+ }
+
+ // Start dev tools protocol handler.
+ LaunchDevToolsHandlerIfNeeded(profile(), parsed_command_line());
// Tests should be able to tune login manager before showing it.
// Thus only show login manager in normal (non-testing) mode.

Powered by Google App Engine
This is Rietveld 408576698