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/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #endif | 72 #endif |
73 } | 73 } |
74 | 74 |
75 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 75 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
76 browser_context_.reset(new ShellBrowserContext(false)); | 76 browser_context_.reset(new ShellBrowserContext(false)); |
77 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); | 77 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); |
78 | 78 |
79 Shell::PlatformInitialize(); | 79 Shell::PlatformInitialize(); |
80 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); | 80 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); |
81 | 81 |
82 #if defined(OS_ANDROID) | |
83 devtools_delegate_ = new ShellDevToolsDelegate( | 82 devtools_delegate_ = new ShellDevToolsDelegate( |
84 browser_context_->GetRequestContext()); | 83 browser_context_->GetRequestContext()); |
85 #else | |
86 devtools_delegate_ = new ShellDevToolsDelegate( | |
87 browser_context_->GetRequestContext()); | |
88 #endif | |
89 | 84 |
90 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 85 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
91 Shell::CreateNewWindow(browser_context_.get(), | 86 Shell::CreateNewWindow(browser_context_.get(), |
92 GetStartupURL(), | 87 GetStartupURL(), |
93 NULL, | 88 NULL, |
94 MSG_ROUTING_NONE, | 89 MSG_ROUTING_NONE, |
95 NULL); | 90 NULL); |
96 } | 91 } |
97 | 92 |
98 if (parameters_.ui_task) { | 93 if (parameters_.ui_task) { |
(...skipping 11 matching lines...) Expand all Loading... |
110 #if defined(USE_AURA) | 105 #if defined(USE_AURA) |
111 Shell::PlatformExit(); | 106 Shell::PlatformExit(); |
112 #endif | 107 #endif |
113 if (devtools_delegate_) | 108 if (devtools_delegate_) |
114 devtools_delegate_->Stop(); | 109 devtools_delegate_->Stop(); |
115 browser_context_.reset(); | 110 browser_context_.reset(); |
116 off_the_record_browser_context_.reset(); | 111 off_the_record_browser_context_.reset(); |
117 } | 112 } |
118 | 113 |
119 } // namespace | 114 } // namespace |
OLD | NEW |