Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/chrome_extensions_browser_client.h" | 5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" |
| 6 | 6 |
| 7 #include "apps/common/api/generated_api.h" | 7 #include "apps/common/api/generated_api.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/version.h" | 9 #include "base/version.h" |
| 10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/extensions/activity_log/activity_log.h" | 12 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 13 #include "chrome/browser/extensions/api/content_settings/content_settings_servic e.h" | |
| 13 #include "chrome/browser/extensions/api/preference/chrome_direct_setting.h" | 14 #include "chrome/browser/extensions/api/preference/chrome_direct_setting.h" |
| 14 #include "chrome/browser/extensions/api/preference/preference_api.h" | 15 #include "chrome/browser/extensions/api/preference/preference_api.h" |
| 15 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 16 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 16 #include "chrome/browser/extensions/chrome_app_sorting.h" | 17 #include "chrome/browser/extensions/chrome_app_sorting.h" |
| 17 #include "chrome/browser/extensions/chrome_extension_host_delegate.h" | 18 #include "chrome/browser/extensions/chrome_extension_host_delegate.h" |
| 18 #include "chrome/browser/extensions/extension_system_factory.h" | 19 #include "chrome/browser/extensions/extension_system_factory.h" |
| 19 #include "chrome/browser/extensions/extension_util.h" | 20 #include "chrome/browser/extensions/extension_util.h" |
| 20 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 21 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 content::BrowserContext* context) const { | 110 content::BrowserContext* context) const { |
| 110 return IsGuestSession(context) | 111 return IsGuestSession(context) |
| 111 || util::CanCrossIncognito(extension, context); | 112 || util::CanCrossIncognito(extension, context); |
| 112 } | 113 } |
| 113 | 114 |
| 114 PrefService* ChromeExtensionsBrowserClient::GetPrefServiceForContext( | 115 PrefService* ChromeExtensionsBrowserClient::GetPrefServiceForContext( |
| 115 content::BrowserContext* context) { | 116 content::BrowserContext* context) { |
| 116 return static_cast<Profile*>(context)->GetPrefs(); | 117 return static_cast<Profile*>(context)->GetPrefs(); |
| 117 } | 118 } |
| 118 | 119 |
| 120 void ChromeExtensionsBrowserClient::GetAdditionalExtensionPrefsObservers( | |
| 121 content::BrowserContext* context, | |
| 122 std::vector<ExtensionPrefsObserver*>* observers) const { | |
| 123 ContentSettingsService* content_settings = | |
| 124 ContentSettingsService::Get(context); | |
| 125 observers->push_back(content_settings); | |
|
Yoyo Zhou
2014/04/02 01:40:33
nit: can collapse 2 lines into 1
Ken Rockot(use gerrit already)
2014/04/02 03:53:01
Done.
| |
| 126 } | |
| 127 | |
| 119 bool ChromeExtensionsBrowserClient::DeferLoadingBackgroundHosts( | 128 bool ChromeExtensionsBrowserClient::DeferLoadingBackgroundHosts( |
| 120 content::BrowserContext* context) const { | 129 content::BrowserContext* context) const { |
| 121 Profile* profile = static_cast<Profile*>(context); | 130 Profile* profile = static_cast<Profile*>(context); |
| 122 | 131 |
| 123 // The profile may not be valid yet if it is still being initialized. | 132 // The profile may not be valid yet if it is still being initialized. |
| 124 // In that case, defer loading, since it depends on an initialized profile. | 133 // In that case, defer loading, since it depends on an initialized profile. |
| 125 // http://crbug.com/222473 | 134 // http://crbug.com/222473 |
| 126 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) | 135 if (!g_browser_process->profile_manager()->IsValidProfile(profile)) |
| 127 return true; | 136 return true; |
| 128 | 137 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 // Generated APIs from lower-level modules. | 241 // Generated APIs from lower-level modules. |
| 233 extensions::core_api::GeneratedFunctionRegistry::RegisterAll(registry); | 242 extensions::core_api::GeneratedFunctionRegistry::RegisterAll(registry); |
| 234 apps::api::GeneratedFunctionRegistry::RegisterAll(registry); | 243 apps::api::GeneratedFunctionRegistry::RegisterAll(registry); |
| 235 | 244 |
| 236 // Generated APIs from Chrome. | 245 // Generated APIs from Chrome. |
| 237 extensions::api::GeneratedFunctionRegistry::RegisterAll(registry); | 246 extensions::api::GeneratedFunctionRegistry::RegisterAll(registry); |
| 238 #endif | 247 #endif |
| 239 } | 248 } |
| 240 | 249 |
| 241 } // namespace extensions | 250 } // namespace extensions |
| OLD | NEW |