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

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: Forgot to clarify ownership comments. 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..654871279ce2097214906b3c37efa82409053c87 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;
}
@@ -97,9 +99,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,
@@ -248,6 +249,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);
@@ -314,6 +340,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