Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4254)

Unified Diff: chrome/browser/content_settings/host_content_settings_map.h

Issue 542253003: Add a global on/off switch for content settings and expose a toggle on the Website Settings options… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@global-settings
Patch Set: Rebase. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/content_settings/cookie_settings.cc ('k') | chrome/browser/content_settings/host_content_settings_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698