| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Enumeration mapping all possible controlled-by values for exceptions to | 6 * Enumeration mapping all possible controlled-by values for exceptions to |
| 7 * icons. | 7 * icons. |
| 8 * @enum {string} | 8 * @enum {string} |
| 9 */ | 9 */ |
| 10 var iconControlledBy = { | 10 var iconControlledBy = { |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 * @param {string} source Where the setting came from. | 210 * @param {string} source Where the setting came from. |
| 211 * @return {boolean} | 211 * @return {boolean} |
| 212 * @private | 212 * @private |
| 213 */ | 213 */ |
| 214 shouldShowMenu_: function(source) { | 214 shouldShowMenu_: function(source) { |
| 215 return !(this.isExceptionControlled_(source) || this.allSites); | 215 return !(this.isExceptionControlled_(source) || this.allSites); |
| 216 }, | 216 }, |
| 217 | 217 |
| 218 /** | 218 /** |
| 219 * A handler for the Add Site button. | 219 * A handler for the Add Site button. |
| 220 * @param {!Event} e |
| 220 * @private | 221 * @private |
| 221 */ | 222 */ |
| 222 onAddSiteTap_: function() { | 223 onAddSiteTap_: function(e) { |
| 224 e.preventDefault(); |
| 223 var dialog = document.createElement('add-site-dialog'); | 225 var dialog = document.createElement('add-site-dialog'); |
| 224 dialog.category = this.category; | 226 dialog.category = this.category; |
| 225 dialog.contentSetting = this.categorySubtype; | 227 dialog.contentSetting = this.categorySubtype; |
| 226 this.shadowRoot.appendChild(dialog); | 228 this.shadowRoot.appendChild(dialog); |
| 227 | 229 |
| 228 dialog.open(this.categorySubtype); | 230 dialog.open(this.categorySubtype); |
| 229 | 231 |
| 230 dialog.addEventListener('close', function() { | 232 dialog.addEventListener('close', function() { |
| 231 dialog.remove(); | 233 dialog.remove(); |
| 232 }); | 234 }); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 Polymer.dom(/** @type {!Event} */ (e)).localTarget)); | 482 Polymer.dom(/** @type {!Event} */ (e)).localTarget)); |
| 481 }, | 483 }, |
| 482 | 484 |
| 483 /** @private */ | 485 /** @private */ |
| 484 closeActionMenu_: function() { | 486 closeActionMenu_: function() { |
| 485 this.actionMenuSite_ = null; | 487 this.actionMenuSite_ = null; |
| 486 /** @type {!CrActionMenuElement} */ ( | 488 /** @type {!CrActionMenuElement} */ ( |
| 487 this.$$('dialog[is=cr-action-menu]')).close(); | 489 this.$$('dialog[is=cr-action-menu]')).close(); |
| 488 }, | 490 }, |
| 489 }); | 491 }); |
| OLD | NEW |