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

Unified Diff: chrome/browser/resources/settings/site_settings/zoom_levels.js

Issue 2323693002: Site Settings Desktop: Implement Zoom Levels category. (Closed)
Patch Set: Fix test Created 4 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/resources/settings/site_settings/zoom_levels.js
diff --git a/chrome/browser/resources/settings/site_settings/zoom_levels.js b/chrome/browser/resources/settings/site_settings/zoom_levels.js
new file mode 100644
index 0000000000000000000000000000000000000000..8d11ef325feb2072cb0e0add94f2f05439a89599
--- /dev/null
+++ b/chrome/browser/resources/settings/site_settings/zoom_levels.js
@@ -0,0 +1,48 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview
+ * 'zoom-levels' is the polymer element for showing the sites that are zoomed in
+ * or out.
+ */
+
+Polymer({
+ is: 'zoom-levels',
+
+ behaviors: [SiteSettingsBehavior, WebUIListenerBehavior],
+
+ properties: {
+ /**
+ * Array of sites that are zoomed in or out.
+ * @type {!Array<ZoomLevelEntry>}
+ */
+ sites_: Array,
+ },
+
+ ready: function() {
+ this.addWebUIListener('onZoomLevelsChanged',
+ this.onZoomLevelsChanged_.bind(this));
+ this.browserProxy.fetchZoomLevels();
+ },
+
+ /**
+ * A handler for when zoom levels change.
+ * @param {!Array<ZoomLevelEntry>} sites The up to date list of sites and
+ * their zoom levels.
+ */
+ onZoomLevelsChanged_: function(sites) {
+ this.sites_ = sites;
+ },
+
+ /**
+ * A handler for when a zoom level for a site is deleted.
+ * @param {!{model: !{index: number}}} event
+ * @private
+ */
+ removeZoomLevel_: function(event) {
+ var site = this.sites_[event.model.index];
+ this.browserProxy.removeZoomLevel(site.origin);
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698