| 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 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-search-engine-entry', | 10 is: 'settings-search-engine-entry', |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 this.closePopupMenu_(); | 81 this.closePopupMenu_(); |
| 82 }, | 82 }, |
| 83 | 83 |
| 84 /** @private */ | 84 /** @private */ |
| 85 onDotsTap_: function() { | 85 onDotsTap_: function() { |
| 86 /** @type {!CrActionMenuElement} */ ( | 86 /** @type {!CrActionMenuElement} */ ( |
| 87 this.$$('dialog[is=cr-action-menu]')).showAt( | 87 this.$$('dialog[is=cr-action-menu]')).showAt( |
| 88 assert(this.$$('paper-icon-button'))); | 88 assert(this.$$('paper-icon-button'))); |
| 89 }, | 89 }, |
| 90 | 90 |
| 91 /** @private */ | 91 /** |
| 92 onEditTap_: function() { | 92 * @param {!Event} e |
| 93 * @private |
| 94 */ |
| 95 onEditTap_: function(e) { |
| 96 e.preventDefault(); |
| 93 this.closePopupMenu_(); | 97 this.closePopupMenu_(); |
| 94 | 98 |
| 95 this.showEditSearchEngineDialog_ = true; | 99 this.showEditSearchEngineDialog_ = true; |
| 96 this.async(function() { | 100 this.async(function() { |
| 97 var dialog = this.$$('settings-search-engine-dialog'); | 101 var dialog = this.$$('settings-search-engine-dialog'); |
| 98 // Register listener to detect when the dialog is closed. Flip the boolean | 102 // Register listener to detect when the dialog is closed. Flip the boolean |
| 99 // once closed to force a restamp next time it is shown such that the | 103 // once closed to force a restamp next time it is shown such that the |
| 100 // previous dialog's contents are cleared. | 104 // previous dialog's contents are cleared. |
| 101 dialog.addEventListener('close', function() { | 105 dialog.addEventListener('close', function() { |
| 102 this.showEditSearchEngineDialog_ = false; | 106 this.showEditSearchEngineDialog_ = false; |
| 103 }.bind(this)); | 107 }.bind(this)); |
| 104 }.bind(this)); | 108 }.bind(this)); |
| 105 }, | 109 }, |
| 106 | 110 |
| 107 /** @private */ | 111 /** @private */ |
| 108 onMakeDefaultTap_: function() { | 112 onMakeDefaultTap_: function() { |
| 109 this.closePopupMenu_(); | 113 this.closePopupMenu_(); |
| 110 this.browserProxy_.setDefaultSearchEngine(this.engine.modelIndex); | 114 this.browserProxy_.setDefaultSearchEngine(this.engine.modelIndex); |
| 111 }, | 115 }, |
| 112 }); | 116 }); |
| OLD | NEW |