Index: chrome/browser/content_settings/host_content_settings_map.h |
diff --git a/chrome/browser/content_settings/host_content_settings_map.h b/chrome/browser/content_settings/host_content_settings_map.h |
index 0331d4f0cff3e2e19054e0d0f95383178c9a0cbc..dbe70c0d1338efa0a2685c37a16b9648c85e6696 100644 |
--- a/chrome/browser/content_settings/host_content_settings_map.h |
+++ b/chrome/browser/content_settings/host_content_settings_map.h |
@@ -18,6 +18,7 @@ |
#include "base/prefs/pref_change_registrar.h" |
#include "base/threading/platform_thread.h" |
#include "base/tuple.h" |
+#include "chrome/browser/content_settings/content_settings_override_provider.h" |
#include "components/content_settings/core/browser/content_settings_observer.h" |
#include "components/content_settings/core/common/content_settings.h" |
#include "components/content_settings/core/common/content_settings_pattern.h" |
@@ -33,6 +34,7 @@ class Value; |
} |
namespace content_settings { |
+class OverrideProvider; |
class ObservableProvider; |
class ProviderInterface; |
class PrefProvider; |
@@ -53,6 +55,7 @@ class HostContentSettingsMap |
INTERNAL_EXTENSION_PROVIDER = 0, |
POLICY_PROVIDER, |
CUSTOM_EXTENSION_PROVIDER, |
+ OVERRIDE_PROVIDER, |
PREF_PROVIDER, |
DEFAULT_PROVIDER, |
NUM_PROVIDER_TYPES, |
@@ -99,9 +102,8 @@ class HostContentSettingsMap |
// setting, NULL is returned and the |source| field of |info| is set to |
// |SETTING_SOURCE_NONE|. The pattern fiels of |info| are set to empty |
// patterns. |
- // The ownership of the resulting |Value| is transfered to the caller. |
// May be called on any thread. |
- base::Value* GetWebsiteSetting( |
+ scoped_ptr<base::Value> GetWebsiteSetting( |
const GURL& primary_url, |
const GURL& secondary_url, |
ContentSettingsType content_type, |
@@ -250,6 +252,31 @@ class HostContentSettingsMap |
const ContentSettingsPattern& secondary_pattern, |
ContentSettingsType content_type); |
+ // Returns the content setting without considering the global on/off toggle |
+ // for the content setting that matches the URLs. |
+ ContentSetting GetContentSettingWithoutOverride( |
+ const GURL& primary_url, |
+ const GURL& secondary_url, |
+ ContentSettingsType content_type, |
+ const std::string& resource_identifier); |
+ |
+ // Returns the single content setting |value| without considering the |
+ // global on/off toggle for the content setting that matches the given |
+ // patterns. |
+ scoped_ptr<base::Value> GetWebsiteSettingWithoutOverride( |
+ const GURL& primary_url, |
+ const GURL& secondary_url, |
+ ContentSettingsType content_type, |
+ const std::string& resource_identifier, |
+ content_settings::SettingInfo* info) const; |
+ |
+ // Sets globally if a given |content_type| |is_enabled|. |
+ void SetContentSettingOverride(ContentSettingsType content_type, |
+ bool is_enabled); |
+ |
+ // Returns if a given |content_type| is enabled. |
+ bool GetContentSettingOverride(ContentSettingsType content_type); |
+ |
// Adds/removes an observer for content settings changes. |
void AddObserver(content_settings::Observer* observer); |
void RemoveObserver(content_settings::Observer* observer); |
@@ -294,6 +321,16 @@ class HostContentSettingsMap |
// it is not being called too late. |
void UsedContentSettingsProviders() const; |
+ // Returns the single content setting |value| with a toggle for if it |
+ // takes the global on/off switch into account. |
+ scoped_ptr<base::Value> GetWebsiteSettingInternal( |
+ const GURL& primary_url, |
+ const GURL& secondary_url, |
+ ContentSettingsType content_type, |
+ const std::string& resource_identifier, |
+ content_settings::SettingInfo* info, |
+ bool get_override) const; |
+ |
content_settings::PrefProvider* GetPrefProvider(); |
#ifndef NDEBUG |