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-engines-page' is the settings page | 6 * @fileoverview 'settings-search-engines-page' is the settings page |
7 * containing search engines settings. | 7 * containing search engines settings. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-search-engines-page', | 10 is: 'settings-search-engines-page', |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 this.extensions = searchEnginesInfo['extensions']; | 98 this.extensions = searchEnginesInfo['extensions']; |
99 }, | 99 }, |
100 | 100 |
101 /** | 101 /** |
102 * @param {!Event} e | 102 * @param {!Event} e |
103 * @private | 103 * @private |
104 */ | 104 */ |
105 onAddSearchEngineTap_: function(e) { | 105 onAddSearchEngineTap_: function(e) { |
106 e.preventDefault(); | 106 e.preventDefault(); |
107 this.showAddSearchEngineDialog_ = true; | 107 this.showAddSearchEngineDialog_ = true; |
108 this.async(function() { | 108 this.async(() => { |
109 var dialog = this.$$('settings-search-engine-dialog'); | 109 var dialog = this.$$('settings-search-engine-dialog'); |
110 // Register listener to detect when the dialog is closed. Flip the boolean | 110 // Register listener to detect when the dialog is closed. Flip the boolean |
111 // once closed to force a restamp next time it is shown such that the | 111 // once closed to force a restamp next time it is shown such that the |
112 // previous dialog's contents are cleared. | 112 // previous dialog's contents are cleared. |
113 dialog.addEventListener('close', function() { | 113 dialog.addEventListener('close', () => { |
114 this.showAddSearchEngineDialog_ = false; | 114 this.showAddSearchEngineDialog_ = false; |
115 cr.ui.focusWithoutInk(assert(this.$.addSearchEngine)); | 115 cr.ui.focusWithoutInk(assert(this.$.addSearchEngine)); |
116 }.bind(this)); | 116 }); |
117 }.bind(this)); | 117 }); |
118 }, | 118 }, |
119 | 119 |
120 /** @private */ | 120 /** @private */ |
121 computeShowExtensionsList_: function() { | 121 computeShowExtensionsList_: function() { |
122 return this.extensions.length > 0; | 122 return this.extensions.length > 0; |
123 }, | 123 }, |
124 }); | 124 }); |
OLD | NEW |