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_client/omaha_query_params.h" | 10 #include "components/omaha_client/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" | |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 kExtensionResourceScheme); | 122 kExtensionResourceScheme); |
121 | 123 |
122 // Return no error. | 124 // Return no error. |
123 return 0; | 125 return 0; |
124 } | 126 } |
125 | 127 |
126 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 128 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
127 // Initialize our "profile" equivalent. | 129 // Initialize our "profile" equivalent. |
128 browser_context_.reset(new ShellBrowserContext(net_log_.get())); | 130 browser_context_.reset(new ShellBrowserContext(net_log_.get())); |
129 | 131 |
| 132 #if defined(USE_AURA) |
130 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory()); | 133 aura::Env::GetInstance()->set_context_factory(content::GetContextFactory()); |
| 134 #endif |
131 | 135 |
132 storage_monitor::StorageMonitor::Create(); | 136 storage_monitor::StorageMonitor::Create(); |
133 | 137 |
134 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); | 138 desktop_controller_.reset(browser_main_delegate_->CreateDesktopController()); |
135 | 139 |
136 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc | 140 // NOTE: Much of this is culled from chrome/test/base/chrome_test_suite.cc |
137 // TODO(jamescook): Initialize user_manager::UserManager. | 141 // TODO(jamescook): Initialize user_manager::UserManager. |
138 net_log_.reset(new content::ShellNetLog("app_shell")); | 142 net_log_.reset(new content::ShellNetLog("app_shell")); |
139 | 143 |
140 device_client_.reset(new ShellDeviceClient); | 144 device_client_.reset(new ShellDeviceClient); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 253 } |
250 | 254 |
251 void ShellBrowserMainParts::CreateExtensionSystem() { | 255 void ShellBrowserMainParts::CreateExtensionSystem() { |
252 DCHECK(browser_context_); | 256 DCHECK(browser_context_); |
253 extension_system_ = static_cast<ShellExtensionSystem*>( | 257 extension_system_ = static_cast<ShellExtensionSystem*>( |
254 ExtensionSystem::Get(browser_context_.get())); | 258 ExtensionSystem::Get(browser_context_.get())); |
255 extension_system_->InitForRegularProfile(true); | 259 extension_system_->InitForRegularProfile(true); |
256 } | 260 } |
257 | 261 |
258 } // namespace extensions | 262 } // namespace extensions |
OLD | NEW |