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

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: 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 b5939b5fcaa726af32e01dda82859553ac1b17ad..0b7f2eed2ab6d878bae235c6f149953678bb9b70 100644
--- a/chrome/browser/content_settings/host_content_settings_map.h
+++ b/chrome/browser/content_settings/host_content_settings_map.h
@@ -19,6 +19,7 @@
#include "base/threading/platform_thread.h"
#include "base/tuple.h"
#include "chrome/browser/content_settings/content_settings_observer.h"
+#include "chrome/browser/content_settings/content_settings_override_provider.h"
#include "chrome/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_types.h"
@@ -33,6 +34,7 @@ class Value;
}
namespace content_settings {
+class OverrideProvider;
class ProviderInterface;
class PrefProvider;
}
@@ -248,6 +250,32 @@ 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.
+ // The ownership of the resulting |Value| is transfered to the caller.
Bernhard Bauer 2014/09/10 09:07:18 If you transfer ownership, consider returning a sc
Daniel Nishi 2014/09/10 16:38:29 This made me realize that GetWebsiteSetting() was
+ 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);
@@ -314,6 +342,7 @@ class HostContentSettingsMap
// time and by RegisterExtensionService, both of which should happen
// before any other uses of it.
ProviderMap content_settings_providers_;
+ content_settings::OverrideProvider override_;
ObserverList<content_settings::Observer> observers_;

Powered by Google App Engine
This is Rietveld 408576698