| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 13 #include "components/omaha_client/omaha_query_params.h" | |
| 14 #include "components/storage_monitor/storage_monitor.h" | 13 #include "components/storage_monitor/storage_monitor.h" |
| 14 #include "components/update_client/update_query_params.h" |
| 15 #include "content/public/browser/child_process_security_policy.h" | 15 #include "content/public/browser/child_process_security_policy.h" |
| 16 #include "content/public/browser/context_factory.h" | 16 #include "content/public/browser/context_factory.h" |
| 17 #include "content/public/browser/devtools_http_handler.h" | 17 #include "content/public/browser/devtools_http_handler.h" |
| 18 #include "content/public/common/result_codes.h" | 18 #include "content/public/common/result_codes.h" |
| 19 #include "content/shell/browser/shell_devtools_manager_delegate.h" | 19 #include "content/shell/browser/shell_devtools_manager_delegate.h" |
| 20 #include "extensions/browser/app_window/app_window_client.h" | 20 #include "extensions/browser/app_window/app_window_client.h" |
| 21 #include "extensions/browser/browser_context_keyed_service_factories.h" | 21 #include "extensions/browser/browser_context_keyed_service_factories.h" |
| 22 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
| 23 #include "extensions/browser/updater/update_service.h" | 23 #include "extensions/browser/updater/update_service.h" |
| 24 #include "extensions/common/constants.h" | 24 #include "extensions/common/constants.h" |
| 25 #include "extensions/common/switches.h" | 25 #include "extensions/common/switches.h" |
| 26 #include "extensions/shell/browser/shell_browser_context.h" | 26 #include "extensions/shell/browser/shell_browser_context.h" |
| 27 #include "extensions/shell/browser/shell_browser_context_keyed_service_factories
.h" | 27 #include "extensions/shell/browser/shell_browser_context_keyed_service_factories
.h" |
| 28 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 28 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
| 29 #include "extensions/shell/browser/shell_desktop_controller_aura.h" | 29 #include "extensions/shell/browser/shell_desktop_controller_aura.h" |
| 30 #include "extensions/shell/browser/shell_device_client.h" | 30 #include "extensions/shell/browser/shell_device_client.h" |
| 31 #include "extensions/shell/browser/shell_extension_system.h" | 31 #include "extensions/shell/browser/shell_extension_system.h" |
| 32 #include "extensions/shell/browser/shell_extension_system_factory.h" | 32 #include "extensions/shell/browser/shell_extension_system_factory.h" |
| 33 #include "extensions/shell/browser/shell_extensions_browser_client.h" | 33 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
| 34 #include "extensions/shell/browser/shell_oauth2_token_service.h" | 34 #include "extensions/shell/browser/shell_oauth2_token_service.h" |
| 35 #include "extensions/shell/browser/shell_omaha_query_params_delegate.h" | |
| 36 #include "extensions/shell/browser/shell_prefs.h" | 35 #include "extensions/shell/browser/shell_prefs.h" |
| 36 #include "extensions/shell/browser/shell_update_query_params_delegate.h" |
| 37 #include "extensions/shell/common/shell_extensions_client.h" | 37 #include "extensions/shell/common/shell_extensions_client.h" |
| 38 #include "extensions/shell/common/switches.h" | 38 #include "extensions/shell/common/switches.h" |
| 39 #include "ui/base/ime/input_method_initializer.h" | 39 #include "ui/base/ime/input_method_initializer.h" |
| 40 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
| 41 | 41 |
| 42 #if defined(USE_AURA) | 42 #if defined(USE_AURA) |
| 43 #include "ui/aura/env.h" | 43 #include "ui/aura/env.h" |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 device_client_.reset(new ShellDeviceClient); | 161 device_client_.reset(new ShellDeviceClient); |
| 162 | 162 |
| 163 extensions_client_.reset(CreateExtensionsClient()); | 163 extensions_client_.reset(CreateExtensionsClient()); |
| 164 ExtensionsClient::Set(extensions_client_.get()); | 164 ExtensionsClient::Set(extensions_client_.get()); |
| 165 | 165 |
| 166 extensions_browser_client_.reset(CreateExtensionsBrowserClient( | 166 extensions_browser_client_.reset(CreateExtensionsBrowserClient( |
| 167 browser_context_.get(), user_pref_service_.get())); | 167 browser_context_.get(), user_pref_service_.get())); |
| 168 ExtensionsBrowserClient::Set(extensions_browser_client_.get()); | 168 ExtensionsBrowserClient::Set(extensions_browser_client_.get()); |
| 169 | 169 |
| 170 omaha_query_params_delegate_.reset(new ShellOmahaQueryParamsDelegate); | 170 update_query_params_delegate_.reset(new ShellUpdateQueryParamsDelegate); |
| 171 omaha_client::OmahaQueryParams::SetDelegate( | 171 update_client::UpdateQueryParams::SetDelegate( |
| 172 omaha_query_params_delegate_.get()); | 172 update_query_params_delegate_.get()); |
| 173 | 173 |
| 174 // Create our custom ExtensionSystem first because other | 174 // Create our custom ExtensionSystem first because other |
| 175 // KeyedServices depend on it. | 175 // KeyedServices depend on it. |
| 176 // TODO(yoz): Move this after EnsureBrowserContextKeyedServiceFactoriesBuilt. | 176 // TODO(yoz): Move this after EnsureBrowserContextKeyedServiceFactoriesBuilt. |
| 177 CreateExtensionSystem(); | 177 CreateExtensionSystem(); |
| 178 | 178 |
| 179 // Register additional KeyedService factories here. See | 179 // Register additional KeyedService factories here. See |
| 180 // ChromeBrowserMainExtraPartsProfiles for details. | 180 // ChromeBrowserMainExtraPartsProfiles for details. |
| 181 EnsureBrowserContextKeyedServiceFactoriesBuilt(); | 181 EnsureBrowserContextKeyedServiceFactoriesBuilt(); |
| 182 ShellExtensionSystemFactory::GetInstance(); | 182 ShellExtensionSystemFactory::GetInstance(); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 | 291 |
| 292 void ShellBrowserMainParts::CreateExtensionSystem() { | 292 void ShellBrowserMainParts::CreateExtensionSystem() { |
| 293 DCHECK(browser_context_); | 293 DCHECK(browser_context_); |
| 294 extension_system_ = static_cast<ShellExtensionSystem*>( | 294 extension_system_ = static_cast<ShellExtensionSystem*>( |
| 295 ExtensionSystem::Get(browser_context_.get())); | 295 ExtensionSystem::Get(browser_context_.get())); |
| 296 extension_system_->InitForRegularProfile(true); | 296 extension_system_->InitForRegularProfile(true); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace extensions | 299 } // namespace extensions |
| OLD | NEW |