Chromium Code Reviews| 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 * @fileoverview 'settings-search-engine-entry' is a component for showing a | 6 * @fileoverview 'settings-search-engine-entry' is a component for showing a |
| 7 * search engine with its name, domain and query URL. | 7 * search engine with its name, domain and query URL. |
| 8 */ | 8 */ |
| 9 (function() { | |
| 10 /** | |
| 11 * The max z index assigned to a <settings-search-engine-entry> so far. Used to | |
| 12 * ensure that the popup menu is displayed correctly. | |
| 13 * @type {number} | |
| 14 */ | |
| 15 var maxZIndex = 0; | |
|
stevenjb
2016/09/26 22:45:20
Can this just be a member of the Polymer object in
| |
| 16 | |
| 9 Polymer({ | 17 Polymer({ |
| 10 is: 'settings-search-engine-entry', | 18 is: 'settings-search-engine-entry', |
| 11 | 19 |
| 12 properties: { | 20 properties: { |
| 13 /** @type {!SearchEngine} */ | 21 /** @type {!SearchEngine} */ |
| 14 engine: Object, | 22 engine: Object, |
| 15 | 23 |
| 16 /** @private {boolean} */ | 24 /** @private {boolean} */ |
| 17 showEditSearchEngineDialog_: Boolean, | 25 showEditSearchEngineDialog_: Boolean, |
| 18 | 26 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 }.bind(this)); | 69 }.bind(this)); |
| 62 }, | 70 }, |
| 63 | 71 |
| 64 /** @private */ | 72 /** @private */ |
| 65 onMakeDefaultTap_: function() { | 73 onMakeDefaultTap_: function() { |
| 66 this.closePopupMenu_(); | 74 this.closePopupMenu_(); |
| 67 this.browserProxy_.setDefaultSearchEngine(this.engine.modelIndex); | 75 this.browserProxy_.setDefaultSearchEngine(this.engine.modelIndex); |
| 68 }, | 76 }, |
| 69 | 77 |
| 70 /** @private */ | 78 /** @private */ |
| 79 onDotsTap_: function() { | |
| 80 this.style.zIndex = ++maxZIndex; | |
| 81 }, | |
| 82 | |
| 83 /** @private */ | |
| 71 closePopupMenu_: function() { | 84 closePopupMenu_: function() { |
| 72 this.$$('iron-dropdown').close(); | 85 this.$$('iron-dropdown').close(); |
| 73 }, | 86 }, |
| 74 | 87 |
| 75 /** | 88 /** |
| 76 * @param {?string} url The icon URL if available. | 89 * @param {?string} url The icon URL if available. |
| 77 * @return {string} A set of icon URLs. | 90 * @return {string} A set of icon URLs. |
| 78 * @private | 91 * @private |
| 79 */ | 92 */ |
| 80 getIconSet_: function(url) { | 93 getIconSet_: function(url) { |
| 81 // Force default icon, if no |engine.iconURL| is available. | 94 // Force default icon, if no |engine.iconURL| is available. |
| 82 return cr.icon.getFavicon(url || ''); | 95 return cr.icon.getFavicon(url || ''); |
| 83 }, | 96 }, |
| 84 }); | 97 }); |
| 98 })(); | |
| OLD | NEW |