OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview |
| 7 * 'zoom-levels' is the polymer element for showing the sites that are zoomed in |
| 8 * or out. |
| 9 */ |
| 10 |
| 11 Polymer({ |
| 12 is: 'zoom-levels', |
| 13 |
| 14 behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], |
| 15 |
| 16 properties: { |
| 17 /** |
| 18 * Array of sites that are zoomed in or out. |
| 19 * @type {!Array<ZoomLevelEntry>} |
| 20 */ |
| 21 sites_: Array, |
| 22 }, |
| 23 |
| 24 ready: function() { |
| 25 this.addWebUIListener('onZoomLevelsChanged', |
| 26 this.onZoomLevelsChanged_.bind(this)); |
| 27 this.browserProxy.fetchZoomLevels(); |
| 28 }, |
| 29 |
| 30 /** |
| 31 * A handler for when zoom levels change. |
| 32 * @param {!Array<ZoomLevelEntry>} sites The up to date list of sites and |
| 33 * their zoom levels. |
| 34 */ |
| 35 onZoomLevelsChanged_: function(sites) { |
| 36 this.sites_ = sites; |
| 37 }, |
| 38 |
| 39 /** |
| 40 * A handler for when a zoom level for a site is deleted. |
| 41 * @param {!{model: !{index: number}}} event |
| 42 * @private |
| 43 */ |
| 44 removeZoomLevel_: function(event) { |
| 45 var site = this.sites_[event.model.index]; |
| 46 this.browserProxy.removeZoomLevel(site.origin); |
| 47 }, |
| 48 }); |
OLD | NEW |