OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/shell_browser_main_parts.h" | 5 #include "content/shell/shell_browser_main_parts.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 #endif | 73 #endif |
74 } | 74 } |
75 | 75 |
76 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 76 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
77 browser_context_.reset(new ShellBrowserContext(false)); | 77 browser_context_.reset(new ShellBrowserContext(false)); |
78 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); | 78 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); |
79 | 79 |
80 Shell::PlatformInitialize(); | 80 Shell::PlatformInitialize(); |
81 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); | 81 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); |
82 | 82 |
83 #if defined(OS_ANDROID) | |
84 devtools_delegate_ = new ShellDevToolsDelegate( | |
pfeldman
2012/08/02 17:05:50
So you want to always have remote debugging-enable
Satish
2012/08/02 17:17:53
For content shell, yes because it is aimed towards
pfeldman
2012/08/02 17:37:53
Sounds good.
| |
85 0, // On android the port number isn't used. | |
86 browser_context_->GetRequestContext()); | |
87 #else | |
83 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 88 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
84 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { | 89 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { |
85 std::string port_str = | 90 std::string port_str = |
86 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); | 91 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
87 int port; | 92 int port; |
88 if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { | 93 if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { |
89 devtools_delegate_ = new ShellDevToolsDelegate( | 94 devtools_delegate_ = new ShellDevToolsDelegate( |
90 port, | 95 port, |
91 browser_context_->GetRequestContext()); | 96 browser_context_->GetRequestContext()); |
92 } else { | 97 } else { |
93 DLOG(WARNING) << "Invalid http debugger port number " << port; | 98 DLOG(WARNING) << "Invalid http debugger port number " << port; |
94 } | 99 } |
95 } | 100 } |
101 #endif | |
96 | 102 |
97 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 103 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
98 Shell::CreateNewWindow(browser_context_.get(), | 104 Shell::CreateNewWindow(browser_context_.get(), |
99 GetStartupURL(), | 105 GetStartupURL(), |
100 NULL, | 106 NULL, |
101 MSG_ROUTING_NONE, | 107 MSG_ROUTING_NONE, |
102 NULL); | 108 NULL); |
103 } | 109 } |
104 | 110 |
105 if (parameters_.ui_task) { | 111 if (parameters_.ui_task) { |
(...skipping 11 matching lines...) Expand all Loading... | |
117 #if defined(USE_AURA) | 123 #if defined(USE_AURA) |
118 Shell::PlatformExit(); | 124 Shell::PlatformExit(); |
119 #endif | 125 #endif |
120 if (devtools_delegate_) | 126 if (devtools_delegate_) |
121 devtools_delegate_->Stop(); | 127 devtools_delegate_->Stop(); |
122 browser_context_.reset(); | 128 browser_context_.reset(); |
123 off_the_record_browser_context_.reset(); | 129 off_the_record_browser_context_.reset(); |
124 } | 130 } |
125 | 131 |
126 } // namespace | 132 } // namespace |
OLD | NEW |