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:52:00
Rebase?
dpapad
2016/09/26 23:04:32
Done.
| |
| 16 | |
| 17 Polymer({ | 9 Polymer({ |
| 18 is: 'settings-search-engine-entry', | 10 is: 'settings-search-engine-entry', |
| 19 | 11 |
| 12 behaviors: [settings.ListItemBehavior], | |
| 13 | |
| 20 properties: { | 14 properties: { |
| 21 /** @type {!SearchEngine} */ | 15 /** @type {!SearchEngine} */ |
| 22 engine: Object, | 16 engine: Object, |
| 23 | 17 |
| 24 /** @private {boolean} */ | 18 /** @private {boolean} */ |
| 25 showEditSearchEngineDialog_: Boolean, | 19 showEditSearchEngineDialog_: Boolean, |
| 26 | 20 |
| 27 /** @type {boolean} */ | 21 /** @type {boolean} */ |
| 28 isDefault: { | 22 isDefault: { |
| 29 reflectToAttribute: true, | 23 reflectToAttribute: true, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 }.bind(this)); | 63 }.bind(this)); |
| 70 }, | 64 }, |
| 71 | 65 |
| 72 /** @private */ | 66 /** @private */ |
| 73 onMakeDefaultTap_: function() { | 67 onMakeDefaultTap_: function() { |
| 74 this.closePopupMenu_(); | 68 this.closePopupMenu_(); |
| 75 this.browserProxy_.setDefaultSearchEngine(this.engine.modelIndex); | 69 this.browserProxy_.setDefaultSearchEngine(this.engine.modelIndex); |
| 76 }, | 70 }, |
| 77 | 71 |
| 78 /** @private */ | 72 /** @private */ |
| 79 onDotsTap_: function() { | |
| 80 this.style.zIndex = ++maxZIndex; | |
| 81 }, | |
| 82 | |
| 83 /** @private */ | |
| 84 closePopupMenu_: function() { | 73 closePopupMenu_: function() { |
| 85 this.$$('iron-dropdown').close(); | 74 this.$$('iron-dropdown').close(); |
| 86 }, | 75 }, |
| 87 | 76 |
| 88 /** | 77 /** |
| 89 * @param {?string} url The icon URL if available. | 78 * @param {?string} url The icon URL if available. |
| 90 * @return {string} A set of icon URLs. | 79 * @return {string} A set of icon URLs. |
| 91 * @private | 80 * @private |
| 92 */ | 81 */ |
| 93 getIconSet_: function(url) { | 82 getIconSet_: function(url) { |
| 94 // Force default icon, if no |engine.iconURL| is available. | 83 // Force default icon, if no |engine.iconURL| is available. |
| 95 return cr.icon.getFavicon(url || ''); | 84 return cr.icon.getFavicon(url || ''); |
| 96 }, | 85 }, |
| 97 }); | 86 }); |
| 98 })(); | |
| OLD | NEW |