| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 }, | 216 }, |
| 217 | 217 |
| 218 /** | 218 /** |
| 219 * Populate the sites list for display. | 219 * Populate the sites list for display. |
| 220 * @private | 220 * @private |
| 221 */ | 221 */ |
| 222 populateList_: function() { | 222 populateList_: function() { |
| 223 if (this.allSites) { | 223 if (this.allSites) { |
| 224 this.getAllSitesList_().then(function(lists) { | 224 this.getAllSitesList_().then(function(lists) { |
| 225 this.processExceptions_(lists); | 225 this.processExceptions_(lists); |
| 226 this.closeActionMenu_(); |
| 226 }.bind(this)); | 227 }.bind(this)); |
| 227 } else { | 228 } else { |
| 228 this.browserProxy_.getExceptionList(this.category).then( | 229 this.browserProxy_.getExceptionList(this.category).then( |
| 229 function(exceptionList) { | 230 function(exceptionList) { |
| 230 this.processExceptions_([exceptionList]); | 231 this.processExceptions_([exceptionList]); |
| 232 this.closeActionMenu_(); |
| 231 }.bind(this)); | 233 }.bind(this)); |
| 232 } | 234 } |
| 233 }, | 235 }, |
| 234 | 236 |
| 235 /** | 237 /** |
| 236 * Process the exception list returned from the native layer. | 238 * Process the exception list returned from the native layer. |
| 237 * @param {!Array<!Array<SiteException>>} data List of sites (exceptions) to | 239 * @param {!Array<!Array<SiteException>>} data List of sites (exceptions) to |
| 238 * process. | 240 * process. |
| 239 * @private | 241 * @private |
| 240 */ | 242 */ |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 this.actionMenuSite_ = e.model.item; | 460 this.actionMenuSite_ = e.model.item; |
| 459 /** @type {!CrActionMenuElement} */ ( | 461 /** @type {!CrActionMenuElement} */ ( |
| 460 this.$$('dialog[is=cr-action-menu]')).showAt( | 462 this.$$('dialog[is=cr-action-menu]')).showAt( |
| 461 /** @type {!Element} */ ( | 463 /** @type {!Element} */ ( |
| 462 Polymer.dom(/** @type {!Event} */ (e)).localTarget)); | 464 Polymer.dom(/** @type {!Event} */ (e)).localTarget)); |
| 463 }, | 465 }, |
| 464 | 466 |
| 465 /** @private */ | 467 /** @private */ |
| 466 closeActionMenu_: function() { | 468 closeActionMenu_: function() { |
| 467 this.actionMenuSite_ = null; | 469 this.actionMenuSite_ = null; |
| 468 /** @type {!CrActionMenuElement} */ ( | 470 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
| 469 this.$$('dialog[is=cr-action-menu]')).close(); | 471 this.$$('dialog[is=cr-action-menu]')); |
| 472 if (actionMenu.open) |
| 473 actionMenu.close(); |
| 470 }, | 474 }, |
| 471 }); | 475 }); |
| OLD | NEW |