OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/event_recorder.h" | 10 #include "base/event_recorder.h" |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 if (command_line_.HasSwitch(switches::kDnsPrefetchDisable)) | 597 if (command_line_.HasSwitch(switches::kDnsPrefetchDisable)) |
598 chrome_browser_net::EnablePredictor(false); | 598 chrome_browser_net::EnablePredictor(false); |
599 | 599 |
600 if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit)) | 600 if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit)) |
601 base::StatisticsRecorder::set_dump_on_exit(true); | 601 base::StatisticsRecorder::set_dump_on_exit(true); |
602 | 602 |
603 if (command_line_.HasSwitch(switches::kRemoteShellPort)) { | 603 if (command_line_.HasSwitch(switches::kRemoteShellPort)) { |
604 std::string port_str = | 604 std::string port_str = |
605 command_line_.GetSwitchValueASCII(switches::kRemoteShellPort); | 605 command_line_.GetSwitchValueASCII(switches::kRemoteShellPort); |
606 int64 port; | 606 int64 port; |
607 if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) | 607 if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) { |
608 g_browser_process->InitDebuggerWrapper(static_cast<int>(port), false); | 608 g_browser_process->InitDevToolsLegacyProtocolHandler( |
609 else | 609 static_cast<int>(port)); |
| 610 } else { |
610 DLOG(WARNING) << "Invalid remote shell port number " << port; | 611 DLOG(WARNING) << "Invalid remote shell port number " << port; |
| 612 } |
611 } else if (command_line_.HasSwitch(switches::kRemoteDebuggingPort)) { | 613 } else if (command_line_.HasSwitch(switches::kRemoteDebuggingPort)) { |
612 std::string port_str = | 614 std::string port_str = |
613 command_line_.GetSwitchValueASCII(switches::kRemoteDebuggingPort); | 615 command_line_.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
614 int64 port; | 616 int64 port; |
615 if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) | 617 if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) { |
616 g_browser_process->InitDebuggerWrapper(static_cast<int>(port), true); | 618 g_browser_process->InitDevToolsHttpProtocolHandler( |
617 else | 619 static_cast<int>(port), |
| 620 ""); |
| 621 } else { |
618 DLOG(WARNING) << "Invalid http debugger port number " << port; | 622 DLOG(WARNING) << "Invalid http debugger port number " << port; |
| 623 } |
619 } | 624 } |
620 | 625 |
621 if (command_line_.HasSwitch(switches::kUserAgent)) { | 626 if (command_line_.HasSwitch(switches::kUserAgent)) { |
622 webkit_glue::SetUserAgent(command_line_.GetSwitchValueASCII( | 627 webkit_glue::SetUserAgent(command_line_.GetSwitchValueASCII( |
623 switches::kUserAgent)); | 628 switches::kUserAgent)); |
624 } | 629 } |
625 | 630 |
626 // Open the required browser windows and tabs. | 631 // Open the required browser windows and tabs. |
627 // First, see if we're being run as an application window. | 632 // First, see if we're being run as an application window. |
628 if (!OpenApplicationWindow(profile)) { | 633 if (!OpenApplicationWindow(profile)) { |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 return false; | 1195 return false; |
1191 automation->SetExpectedTabCount(expected_tabs); | 1196 automation->SetExpectedTabCount(expected_tabs); |
1192 | 1197 |
1193 AutomationProviderList* list = | 1198 AutomationProviderList* list = |
1194 g_browser_process->InitAutomationProviderList(); | 1199 g_browser_process->InitAutomationProviderList(); |
1195 DCHECK(list); | 1200 DCHECK(list); |
1196 list->AddProvider(automation); | 1201 list->AddProvider(automation); |
1197 | 1202 |
1198 return true; | 1203 return true; |
1199 } | 1204 } |
OLD | NEW |