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

Unified Diff: chrome/browser/ui/zoom/chrome_zoom_level_prefs.h

Issue 2630583002: Add setting to isolate zoom changes by default. (Closed)
Patch Set: Add more tests. Created 3 years, 11 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/ui/zoom/chrome_zoom_level_prefs.h
diff --git a/chrome/browser/ui/zoom/chrome_zoom_level_prefs.h b/chrome/browser/ui/zoom/chrome_zoom_level_prefs.h
index 4799e23f1ccbadbca9c41d970a89f55e60bbeb4d..9480399bacb4bc2faff40f3f21bfeb7fe5327f4c 100644
--- a/chrome/browser/ui/zoom/chrome_zoom_level_prefs.h
+++ b/chrome/browser/ui/zoom/chrome_zoom_level_prefs.h
@@ -31,7 +31,8 @@ class ZoomEventManager;
// levels in HostZoomMap and Chrome's preference system. All changes
// to the per-partition default zoom levels from chrome/ flow through this
// class. Any changes to per-host levels are updated when HostZoomMap calls
-// OnZoomLevelChanged.
+// OnZoomLevelChanged. This also provides access to the default zoom scope
+// preference.
class ChromeZoomLevelPrefs : public content::ZoomLevelDelegate {
public:
typedef base::CallbackList<void(void)>::Subscription
@@ -55,6 +56,8 @@ class ChromeZoomLevelPrefs : public content::ZoomLevelDelegate {
std::unique_ptr<DefaultZoomLevelSubscription>
RegisterDefaultZoomLevelCallback(const base::Closure& callback);
+ void SetIsOriginScopePref(bool default_per_origin);
+
void ExtractPerHostZoomLevels(
const base::DictionaryValue* host_zoom_dictionary,
bool sanitize_partition_host_zoom_levels);
@@ -62,6 +65,10 @@ class ChromeZoomLevelPrefs : public content::ZoomLevelDelegate {
// content::ZoomLevelDelegate
void InitHostZoomMap(content::HostZoomMap* host_zoom_map) override;
+ bool GetIsOriginScopePref() const override;
+ std::unique_ptr<DefaultZoomScopeSubscription>
+ RegisterDefaultZoomScopeCallback(const base::Closure& callback) override;
+
private:
// This is a callback function that receives notifications from HostZoomMap
// when per-host zoom levels change. It is used to update the per-host
@@ -74,6 +81,7 @@ class ChromeZoomLevelPrefs : public content::ZoomLevelDelegate {
std::unique_ptr<content::HostZoomMap::Subscription> zoom_subscription_;
std::string partition_key_;
base::CallbackList<void(void)> default_zoom_changed_callbacks_;
+ base::CallbackList<void(void)> default_scope_changed_callbacks_;
DISALLOW_COPY_AND_ASSIGN(ChromeZoomLevelPrefs);
};

Powered by Google App Engine
This is Rietveld 408576698