Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / resources / settings / search_engines_page / search_engine_adder.js
blob080a2dedc5f67c72b066b29f93e31157c96fa601
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
3 // found in the LICENSE file.
5 /**
6 * @fileoverview 'cr-search-engine-adder' is a component for adding a new search
7 * engine.
9 * @group Chrome Settings Elements
10 * @element cr-settings-search-engine-adder
12 Polymer({
13 is: 'cr-search-engine-adder',
15 /** @private */
16 add_: function() {
17 if (!this.$.domainField.isInvalid &&
18 !this.$.keywordField.isInvalid &&
19 !this.$.queryURLField.isInvalid) {
20 chrome.searchEnginesPrivate.addOtherSearchEngine(
21 /* name */ this.$.domainField.value,
22 /* keyword */ this.$.keywordField.value,
23 /* url */ this.$.queryURLField.value);
24 this.$.domainField.value = '';
25 this.$.keywordField.value = '';
26 this.$.queryURLField.value = '';
29 });