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 "components/storage_monitor/storage_monitor.h" | 11 #include "components/storage_monitor/storage_monitor.h" |
12 #include "content/public/browser/child_process_security_policy.h" | 12 #include "content/public/browser/child_process_security_policy.h" |
13 #include "content/public/browser/context_factory.h" | 13 #include "content/public/browser/context_factory.h" |
14 #include "content/public/browser/devtools_http_handler.h" | 14 #include "content/public/browser/devtools_http_handler.h" |
15 #include "content/public/common/result_codes.h" | 15 #include "content/public/common/result_codes.h" |
16 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 16 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
17 #include "content/shell/browser/shell_net_log.h" | 17 #include "content/shell/browser/shell_net_log.h" |
18 #include "extensions/browser/app_window/app_window_client.h" | 18 #include "extensions/browser/app_window/app_window_client.h" |
19 #include "extensions/browser/browser_context_keyed_service_factories.h" | 19 #include "extensions/browser/browser_context_keyed_service_factories.h" |
20 #include "extensions/browser/extension_system.h" | 20 #include "extensions/browser/extension_system.h" |
21 #include "extensions/browser/updater/update_service.h" | 21 #include "extensions/browser/updater/update_service.h" |
22 #include "extensions/common/constants.h" | 22 #include "extensions/common/constants.h" |
23 #include "extensions/common/switches.h" | 23 #include "extensions/common/switches.h" |
24 #include "extensions/shell/browser/shell_browser_context.h" | 24 #include "extensions/shell/browser/shell_browser_context.h" |
25 #include "extensions/shell/browser/shell_browser_context_keyed_service_factories .h" | 25 #include "extensions/shell/browser/shell_browser_context_keyed_service_factories .h" |
26 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 26 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
27 #include "extensions/shell/browser/shell_desktop_controller.h" | 27 #include "extensions/shell/browser/shell_desktop_controller_aura.h" |
28 #include "extensions/shell/browser/shell_device_client.h" | 28 #include "extensions/shell/browser/shell_device_client.h" |
29 #include "extensions/shell/browser/shell_extension_system.h" | 29 #include "extensions/shell/browser/shell_extension_system.h" |
30 #include "extensions/shell/browser/shell_extension_system_factory.h" | 30 #include "extensions/shell/browser/shell_extension_system_factory.h" |
31 #include "extensions/shell/browser/shell_extensions_browser_client.h" | 31 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
32 #include "extensions/shell/browser/shell_oauth2_token_service.h" | 32 #include "extensions/shell/browser/shell_oauth2_token_service.h" |
33 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h" | 33 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h" |
34 #include "extensions/shell/common/shell_extensions_client.h" | 34 #include "extensions/shell/common/shell_extensions_client.h" |
35 #include "extensions/shell/common/switches.h" | 35 #include "extensions/shell/common/switches.h" |
36 #include "ui/aura/env.h" | |
37 #include "ui/aura/window_tree_host.h" | |
James Cook
2014/11/11 18:23:52
Thanks for cleaning this up.
| |
38 #include "ui/base/ime/input_method_initializer.h" | 36 #include "ui/base/ime/input_method_initializer.h" |
39 #include "ui/base/resource/resource_bundle.h" | 37 #include "ui/base/resource/resource_bundle.h" |
40 | 38 |
39 #if defined(USE_AURA) | |
40 #include "ui/aura/env.h" | |
41 #endif | |
42 | |
41 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
42 #include "chromeos/audio/cras_audio_handler.h" | 44 #include "chromeos/audio/cras_audio_handler.h" |
43 #include "chromeos/dbus/dbus_thread_manager.h" | 45 #include "chromeos/dbus/dbus_thread_manager.h" |
44 #include "chromeos/network/network_handler.h" | 46 #include "chromeos/network/network_handler.h" |
45 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" | 47 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" |
46 #include "extensions/shell/browser/shell_network_controller_chromeos.h" | 48 #include "extensions/shell/browser/shell_network_controller_chromeos.h" |
47 #endif | 49 #endif |
48 | 50 |
49 #if !defined(DISABLE_NACL) | 51 #if !defined(DISABLE_NACL) |
50 #include "components/nacl/browser/nacl_browser.h" | 52 #include "components/nacl/browser/nacl_browser.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 kExtensionResourceScheme); | 125 kExtensionResourceScheme); |
124 | 126 |
125 // Return no error. | 127 // Return no error. |
126 return 0; | 128 return 0; |
127 } | 129 } |
128 | 130 |
129 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 131 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
130 // Initialize our "profile" equivalent. | 132 // Initialize our "profile" equivalent. |
131 browser_context_.reset(new ShellBrowserContext(net_log_.get())); | 133 browser_context_.reset(new ShellBrowserContext(net_log_.get())); |
132 | 134 |
135 #if defined(USE_AURA) | |
133 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory()); | 136 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory()); |
137 #endif | |
134 | 138 |
135 storage_monitor::StorageMonitor::Create(); | 139 storage_monitor::StorageMonitor::Create(); |
136 | 140 |
137 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); | 141 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); |
138 | 142 |
139 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc | 143 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc |
140 // TODO(jamescook): Initialize user_manager::UserManager. | 144 // TODO(jamescook): Initialize user_manager::UserManager. |
141 net_log_.reset(new content::ShellNetLog("app_shell")); | 145 net_log_.reset(new content::ShellNetLog("app_shell")); |
142 | 146 |
143 device_client_.reset(new ShellDeviceClient); | 147 device_client_.reset(new ShellDeviceClient); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 } | 256 } |
253 | 257 |
254 void ShellBrowserMainParts::CreateExtensionSystem() { | 258 void ShellBrowserMainParts::CreateExtensionSystem() { |
255 DCHECK(browser_context_); | 259 DCHECK(browser_context_); |
256 extension_system_ = static_cast<ShellExtensionSystem*>( | 260 extension_system_ = static_cast<ShellExtensionSystem*>( |
257 ExtensionSystem::Get(browser_context_.get())); | 261 ExtensionSystem::Get(browser_context_.get())); |
258 extension_system_->InitForRegularProfile(true); | 262 extension_system_->InitForRegularProfile(true); |
259 } | 263 } |
260 | 264 |
261 } // namespace extensions | 265 } // namespace extensions |
OLD | NEW |