Chromium Code Reviews| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 } | 630 } |
| 631 | 631 |
| 632 if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit)) | 632 if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit)) |
| 633 base::StatisticsRecorder::set_dump_on_exit(true); | 633 base::StatisticsRecorder::set_dump_on_exit(true); |
| 634 | 634 |
| 635 if (command_line_.HasSwitch(switches::kRemoteDebuggingPort)) { | 635 if (command_line_.HasSwitch(switches::kRemoteDebuggingPort)) { |
| 636 std::string port_str = | 636 std::string port_str = |
| 637 command_line_.GetSwitchValueASCII(switches::kRemoteDebuggingPort); | 637 command_line_.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
| 638 int64 port; | 638 int64 port; |
| 639 if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) { | 639 if (base::StringToInt64(port_str, &port) && port > 0 && port < 65535) { |
| 640 std::string frontend_str; | |
| 641 if (command_line_.HasSwitch(switches::kRemoteDebuggingFrontend)) { | |
| 642 frontend_str = command_line_.GetSwitchValueASCII( | |
| 643 switches::kRemoteDebuggingFrontend); | |
|
yurys
2011/12/02 12:12:54
nit: wrong alignment
| |
| 644 } | |
| 640 g_browser_process->InitDevToolsHttpProtocolHandler( | 645 g_browser_process->InitDevToolsHttpProtocolHandler( |
| 641 profile, | 646 profile, |
| 642 "127.0.0.1", | 647 "127.0.0.1", |
| 643 static_cast<int>(port), | 648 static_cast<int>(port), |
| 644 ""); | 649 frontend_str); |
| 645 } else { | 650 } else { |
| 646 DLOG(WARNING) << "Invalid http debugger port number " << port; | 651 DLOG(WARNING) << "Invalid http debugger port number " << port; |
| 647 } | 652 } |
| 648 } | 653 } |
| 649 | 654 |
| 650 // Open the required browser windows and tabs. First, see if | 655 // Open the required browser windows and tabs. First, see if |
| 651 // we're being run as an application window. If so, the user | 656 // we're being run as an application window. If so, the user |
| 652 // opened an app shortcut. Don't restore tabs or open initial | 657 // opened an app shortcut. Don't restore tabs or open initial |
| 653 // URLs in that case. The user should see the window as an app, | 658 // URLs in that case. The user should see the window as an app, |
| 654 // not as chrome. | 659 // not as chrome. |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1481 if (!automation->InitializeChannel(channel_id)) | 1486 if (!automation->InitializeChannel(channel_id)) |
| 1482 return false; | 1487 return false; |
| 1483 automation->SetExpectedTabCount(expected_tabs); | 1488 automation->SetExpectedTabCount(expected_tabs); |
| 1484 | 1489 |
| 1485 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1490 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
| 1486 DCHECK(list); | 1491 DCHECK(list); |
| 1487 list->AddProvider(automation); | 1492 list->AddProvider(automation); |
| 1488 | 1493 |
| 1489 return true; | 1494 return true; |
| 1490 } | 1495 } |
| OLD | NEW |