Chromium Code Reviews| Index: chrome/browser/content_settings/host_content_settings_map.cc |
| diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc |
| index e6ec4d3ea7fccb0afb7d376418b4a9a48d8bd6c4..7b2f308a09fa3d7c35ce6833231a01b19387aaf6 100644 |
| --- a/chrome/browser/content_settings/host_content_settings_map.cc |
| +++ b/chrome/browser/content_settings/host_content_settings_map.cc |
| @@ -13,7 +13,6 @@ |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "base/time/clock.h" |
| -#include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/content_settings/content_settings_custom_extension_provider.h" |
| #include "chrome/browser/content_settings/content_settings_default_provider.h" |
| #include "chrome/browser/content_settings/content_settings_details.h" |
| @@ -24,25 +23,18 @@ |
| #include "chrome/browser/content_settings/content_settings_provider.h" |
| #include "chrome/browser/content_settings/content_settings_rule.h" |
| #include "chrome/browser/content_settings/content_settings_utils.h" |
| -#include "chrome/browser/extensions/api/content_settings/content_settings_service.h" |
| -#include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| #include "components/content_settings/core/common/content_settings_pattern.h" |
| #include "components/pref_registry/pref_registry_syncable.h" |
| #include "content/public/browser/browser_thread.h" |
| -#include "content/public/browser/notification_service.h" |
| -#include "content/public/browser/notification_source.h" |
| -#include "content/public/browser/user_metrics.h" |
| #include "content/public/common/content_switches.h" |
| -#include "extensions/browser/extension_prefs.h" |
| #include "extensions/common/constants.h" |
| #include "net/base/net_errors.h" |
| #include "net/base/static_cookie_policy.h" |
| #include "url/gurl.h" |
| -using base::UserMetricsAction; |
| using content::BrowserThread; |
| namespace { |
| @@ -108,40 +100,6 @@ HostContentSettingsMap::HostContentSettingsMap( |
| } |
| } |
| -#if defined(ENABLE_EXTENSIONS) |
| -void HostContentSettingsMap::RegisterExtensionService( |
| - ExtensionService* extension_service) { |
| - DCHECK(extension_service); |
| - DCHECK(!content_settings_providers_[INTERNAL_EXTENSION_PROVIDER]); |
| - DCHECK(!content_settings_providers_[CUSTOM_EXTENSION_PROVIDER]); |
| - |
| - content_settings::InternalExtensionProvider* internal_extension_provider = |
| - new content_settings::InternalExtensionProvider(extension_service); |
| - internal_extension_provider->AddObserver(this); |
| - content_settings_providers_[INTERNAL_EXTENSION_PROVIDER] = |
| - internal_extension_provider; |
| - |
| - content_settings::ObservableProvider* custom_extension_provider = |
| - new content_settings::CustomExtensionProvider( |
| - extensions::ContentSettingsService::Get( |
| - extension_service->GetBrowserContext())->content_settings_store(), |
| - is_off_the_record_); |
| - custom_extension_provider->AddObserver(this); |
| - content_settings_providers_[CUSTOM_EXTENSION_PROVIDER] = |
| - custom_extension_provider; |
| - |
| -#ifndef NDEBUG |
| - DCHECK(used_from_thread_id_ != base::kInvalidThreadId) |
| - << "Used from multiple threads before initialization complete."; |
| -#endif |
| - |
| - OnContentSettingChanged(ContentSettingsPattern(), |
| - ContentSettingsPattern(), |
| - CONTENT_SETTINGS_TYPE_DEFAULT, |
| - std::string()); |
| -} |
| -#endif |
| - |
| // static |
| void HostContentSettingsMap::RegisterProfilePrefs( |
| user_prefs::PrefRegistrySyncable* registry) { |
| @@ -164,6 +122,24 @@ void HostContentSettingsMap::RegisterProfilePrefs( |
| content_settings::PolicyProvider::RegisterProfilePrefs(registry); |
| } |
| +void HostContentSettingsMap::RegisterProvider( |
| + ProviderType type, |
| + scoped_ptr<content_settings::ObservableProvider> provider) { |
| + DCHECK(!content_settings_providers_[type]); |
| + provider->AddObserver(this); |
| + content_settings_providers_[type] = provider.release(); |
| + |
| +#ifndef NDEBUG |
| + DCHECK(used_from_thread_id_ != base::kInvalidThreadId) |
|
Yoyo Zhou
2014/09/08 19:51:26
DCHECK_NE
Jun Mukai
2014/09/08 20:01:39
Done.
|
| + << "Used from multiple threads before initialization complete."; |
| +#endif |
| + |
| + OnContentSettingChanged(ContentSettingsPattern(), |
| + ContentSettingsPattern(), |
| + CONTENT_SETTINGS_TYPE_DEFAULT, |
| + std::string()); |
| +} |
| + |
| ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider( |
| ContentSettingsType content_type, |
| content_settings::ProviderInterface* provider) const { |