OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 A helper object used from the "Manage search engines" section | 6 * @fileoverview A helper object used from the "Manage search engines" section |
7 * to interact with the browser. | 7 * to interact with the browser. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 * @return {!Promise<!SearchEnginesInfo>} | 61 * @return {!Promise<!SearchEnginesInfo>} |
62 */ | 62 */ |
63 getSearchEnginesList: function() {}, | 63 getSearchEnginesList: function() {}, |
64 | 64 |
65 /** | 65 /** |
66 * @param {string} fieldName | 66 * @param {string} fieldName |
67 * @param {string} fieldValue | 67 * @param {string} fieldValue |
68 * @return {!Promise<boolean>} | 68 * @return {!Promise<boolean>} |
69 */ | 69 */ |
70 validateSearchEngineInput: function(fieldName, fieldValue) {}, | 70 validateSearchEngineInput: function(fieldName, fieldValue) {}, |
71 | |
72 /** @param {string} extensionId */ | |
73 disableExtension: function(extensionId) {}, | |
74 | |
75 /** @param {string} extensionId */ | |
76 manageExtension: function(extensionId) {}, | |
77 }; | 71 }; |
78 | 72 |
79 /** | 73 /** |
80 * @constructor | 74 * @constructor |
81 * @implements {settings.SearchEnginesBrowserProxy} | 75 * @implements {settings.SearchEnginesBrowserProxy} |
82 */ | 76 */ |
83 function SearchEnginesBrowserProxyImpl() {} | 77 function SearchEnginesBrowserProxyImpl() {} |
84 // The singleton instance_ is replaced with a test version of this wrapper | 78 // The singleton instance_ is replaced with a test version of this wrapper |
85 // during testing. | 79 // during testing. |
86 cr.addSingletonGetter(SearchEnginesBrowserProxyImpl); | 80 cr.addSingletonGetter(SearchEnginesBrowserProxyImpl); |
(...skipping 29 matching lines...) Expand all Loading... |
116 /** @override */ | 110 /** @override */ |
117 getSearchEnginesList: function() { | 111 getSearchEnginesList: function() { |
118 return cr.sendWithPromise('getSearchEnginesList'); | 112 return cr.sendWithPromise('getSearchEnginesList'); |
119 }, | 113 }, |
120 | 114 |
121 /** @override */ | 115 /** @override */ |
122 validateSearchEngineInput: function(fieldName, fieldValue) { | 116 validateSearchEngineInput: function(fieldName, fieldValue) { |
123 return cr.sendWithPromise( | 117 return cr.sendWithPromise( |
124 'validateSearchEngineInput', fieldName, fieldValue); | 118 'validateSearchEngineInput', fieldName, fieldValue); |
125 }, | 119 }, |
126 | |
127 /** @override */ | |
128 disableExtension: function(extensionId) { | |
129 chrome.send('disableExtension', [extensionId]); | |
130 }, | |
131 | |
132 /** @override */ | |
133 manageExtension: function(extensionId) { | |
134 window.open('chrome://extensions?id=' + extensionId); | |
135 }, | |
136 }; | 120 }; |
137 | 121 |
138 return { | 122 return { |
139 SearchEnginesBrowserProxy: SearchEnginesBrowserProxy, | 123 SearchEnginesBrowserProxy: SearchEnginesBrowserProxy, |
140 SearchEnginesBrowserProxyImpl: SearchEnginesBrowserProxyImpl, | 124 SearchEnginesBrowserProxyImpl: SearchEnginesBrowserProxyImpl, |
141 }; | 125 }; |
142 }); | 126 }); |
OLD | NEW |