| 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 'cr-search-engine-adder' is a component for adding a new search | 6 * @fileoverview 'cr-search-engine-adder' is a component for adding a new search |
| 7 * engine. | 7 * engine. |
| 8 * | 8 * |
| 9 * @group Chrome Settings Elements | 9 * @group Chrome Settings Elements |
| 10 * @element cr-settings-search-engine-adder | 10 * @element cr-settings-search-engine-adder |
| 11 */ | 11 */ |
| 12 Polymer('cr-search-engine-adder', { | 12 Polymer({ |
| 13 is: 'cr-search-engine-adder', |
| 14 |
| 13 /** @private */ | 15 /** @private */ |
| 14 add_: function() { | 16 add_: function() { |
| 15 if (!this.$.domainField.isInvalid && | 17 if (!this.$.domainField.isInvalid && |
| 16 !this.$.keywordField.isInvalid && | 18 !this.$.keywordField.isInvalid && |
| 17 !this.$.queryURLField.isInvalid) { | 19 !this.$.queryURLField.isInvalid) { |
| 18 chrome.searchEnginesPrivate.addOtherSearchEngine( | 20 chrome.searchEnginesPrivate.addOtherSearchEngine( |
| 19 /* name */ this.$.domainField.value, | 21 /* name */ this.$.domainField.value, |
| 20 /* keyword */ this.$.keywordField.value, | 22 /* keyword */ this.$.keywordField.value, |
| 21 /* url */ this.$.queryURLField.value); | 23 /* url */ this.$.queryURLField.value); |
| 22 this.$.domainField.value = ''; | 24 this.$.domainField.value = ''; |
| 23 this.$.keywordField.value = ''; | 25 this.$.keywordField.value = ''; |
| 24 this.$.queryURLField.value = ''; | 26 this.$.queryURLField.value = ''; |
| 25 } | 27 } |
| 26 }, | 28 }, |
| 27 }); | 29 }); |
| OLD | NEW |