OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_browser_main_parts.h" | 5 #include "extensions/shell/browser/shell_browser_main_parts.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
10 #include "components/omaha_query_params/omaha_query_params.h" | 10 #include "components/omaha_query_params/omaha_query_params.h" |
11 #include "content/public/browser/child_process_security_policy.h" | 11 #include "content/public/browser/child_process_security_policy.h" |
12 #include "content/public/browser/context_factory.h" | 12 #include "content/public/browser/context_factory.h" |
13 #include "content/public/common/result_codes.h" | 13 #include "content/public/common/result_codes.h" |
14 #include "content/shell/browser/shell_devtools_delegate.h" | 14 #include "content/shell/browser/shell_devtools_delegate.h" |
15 #include "content/shell/browser/shell_net_log.h" | 15 #include "content/shell/browser/shell_net_log.h" |
16 #include "extensions/browser/app_window/app_window_client.h" | 16 #include "extensions/browser/app_window/app_window_client.h" |
17 #include "extensions/browser/browser_context_keyed_service_factories.h" | 17 #include "extensions/browser/browser_context_keyed_service_factories.h" |
18 #include "extensions/browser/extension_system.h" | 18 #include "extensions/browser/extension_system.h" |
19 #include "extensions/common/constants.cc" | 19 #include "extensions/common/constants.cc" |
| 20 #include "extensions/common/switches.h" |
20 #include "extensions/shell/browser/shell_browser_context.h" | 21 #include "extensions/shell/browser/shell_browser_context.h" |
21 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 22 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
22 #include "extensions/shell/browser/shell_desktop_controller.h" | 23 #include "extensions/shell/browser/shell_desktop_controller.h" |
23 #include "extensions/shell/browser/shell_device_client.h" | 24 #include "extensions/shell/browser/shell_device_client.h" |
24 #include "extensions/shell/browser/shell_extension_system.h" | 25 #include "extensions/shell/browser/shell_extension_system.h" |
25 #include "extensions/shell/browser/shell_extension_system_factory.h" | 26 #include "extensions/shell/browser/shell_extension_system_factory.h" |
26 #include "extensions/shell/browser/shell_extensions_browser_client.h" | 27 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
27 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h" | 28 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h" |
28 #include "extensions/shell/common/shell_extensions_client.h" | 29 #include "extensions/shell/common/shell_extensions_client.h" |
29 #include "extensions/shell/common/switches.h" | 30 #include "extensions/shell/common/switches.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 kExtensionScheme); | 103 kExtensionScheme); |
103 content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 104 content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
104 kExtensionResourceScheme); | 105 kExtensionResourceScheme); |
105 | 106 |
106 // Return no error. | 107 // Return no error. |
107 return 0; | 108 return 0; |
108 } | 109 } |
109 | 110 |
110 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 111 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
111 // Initialize our "profile" equivalent. | 112 // Initialize our "profile" equivalent. |
112 browser_context_.reset(new ShellBrowserContext); | 113 browser_context_.reset(new ShellBrowserContext(net_log_.get())); |
113 | 114 |
114 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory()); | 115 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory()); |
115 | 116 |
116 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 117 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
117 storage_monitor::StorageMonitor::Create(); | 118 storage_monitor::StorageMonitor::Create(); |
118 #endif | 119 #endif |
119 | 120 |
120 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); | 121 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); |
121 | 122 |
122 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc | 123 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 210 } |
210 | 211 |
211 void ShellBrowserMainParts::CreateExtensionSystem() { | 212 void ShellBrowserMainParts::CreateExtensionSystem() { |
212 DCHECK(browser_context_); | 213 DCHECK(browser_context_); |
213 extension_system_ = static_cast<ShellExtensionSystem*>( | 214 extension_system_ = static_cast<ShellExtensionSystem*>( |
214 ExtensionSystem::Get(browser_context_.get())); | 215 ExtensionSystem::Get(browser_context_.get())); |
215 extension_system_->InitForRegularProfile(true); | 216 extension_system_->InitForRegularProfile(true); |
216 } | 217 } |
217 | 218 |
218 } // namespace extensions | 219 } // namespace extensions |
OLD | NEW |