| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 /** | 61 /** |
| 62 * @param {!SearchEnginesInfo} searchEnginesInfo | 62 * @param {!SearchEnginesInfo} searchEnginesInfo |
| 63 * @private | 63 * @private |
| 64 */ | 64 */ |
| 65 enginesChanged_: function(searchEnginesInfo) { | 65 enginesChanged_: function(searchEnginesInfo) { |
| 66 this.defaultEngines = searchEnginesInfo['defaults']; | 66 this.defaultEngines = searchEnginesInfo['defaults']; |
| 67 this.otherEngines = searchEnginesInfo['others']; | 67 this.otherEngines = searchEnginesInfo['others']; |
| 68 this.extensions = searchEnginesInfo['extensions']; | 68 this.extensions = searchEnginesInfo['extensions']; |
| 69 }, | 69 }, |
| 70 | 70 |
| 71 /** @private */ | 71 /** |
| 72 onAddSearchEngineTap_: function() { | 72 * @param {!Event} e |
| 73 * @private |
| 74 */ |
| 75 onAddSearchEngineTap_: function(e) { |
| 76 e.preventDefault(); |
| 73 this.showAddSearchEngineDialog_ = true; | 77 this.showAddSearchEngineDialog_ = true; |
| 74 this.async(function() { | 78 this.async(function() { |
| 75 var dialog = this.$$('settings-search-engine-dialog'); | 79 var dialog = this.$$('settings-search-engine-dialog'); |
| 76 // Register listener to detect when the dialog is closed. Flip the boolean | 80 // Register listener to detect when the dialog is closed. Flip the boolean |
| 77 // once closed to force a restamp next time it is shown such that the | 81 // once closed to force a restamp next time it is shown such that the |
| 78 // previous dialog's contents are cleared. | 82 // previous dialog's contents are cleared. |
| 79 dialog.addEventListener('close', function() { | 83 dialog.addEventListener('close', function() { |
| 80 this.showAddSearchEngineDialog_ = false; | 84 this.showAddSearchEngineDialog_ = false; |
| 81 }.bind(this)); | 85 }.bind(this)); |
| 82 }.bind(this)); | 86 }.bind(this)); |
| 83 }, | 87 }, |
| 84 | 88 |
| 85 /** @private */ | 89 /** @private */ |
| 86 computeShowExtensionsList_: function() { | 90 computeShowExtensionsList_: function() { |
| 87 return this.extensions.length > 0; | 91 return this.extensions.length > 0; |
| 88 }, | 92 }, |
| 89 }); | 93 }); |
| OLD | NEW |