OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 7 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
8 | 8 |
9 /** | 9 /** |
10 * Encapsulated handling of search engine management page. | 10 * Encapsulated handling of search engine management page. |
11 * @constructor | 11 * @constructor |
12 */ | 12 */ |
13 function SearchEngineManager() { | 13 function SearchEngineManager() { |
14 this.activeNavTab = null; | 14 this.activeNavTab = null; |
15 OptionsPage.call(this, 'searchEngines', | 15 OptionsPage.call(this, 'searchEngines', |
16 loadTimeData.getString('searchEngineManagerPageTabTitle'), | 16 loadTimeData.getString('searchEngineManagerPageTabTitle'), |
17 'search-engine-manager-page'); | 17 'search-engine-manager-page'); |
18 } | 18 } |
19 | 19 |
20 cr.addSingletonGetter(SearchEngineManager); | 20 cr.addSingletonGetter(SearchEngineManager); |
21 | 21 |
22 SearchEngineManager.prototype = { | 22 SearchEngineManager.prototype = { |
23 __proto__: OptionsPage.prototype, | 23 __proto__: OptionsPage.prototype, |
24 | 24 |
25 /** | 25 /** |
26 * List for default search engine options. | 26 * List for default search engine options. |
27 * @private | 27 * @private |
28 */ | 28 */ |
29 defaultsList_: null, | 29 defaultsList_: null, |
Dan Beam
2013/05/31 03:33:56
I didn't see that it was in the same class, sorry
Aaron Jacobs
2013/06/03 22:48:33
Done.
| |
30 | 30 |
31 /** | 31 /** |
32 * List for other search engine options. | 32 * List for other search engine options. |
33 * @private | 33 * @private |
34 */ | 34 */ |
35 othersList_: null, | 35 othersList_: null, |
36 | 36 |
37 /** | 37 /** |
38 * List for extension keywords. | 38 * List for extension keywords. |
39 * @private | 39 * @private |
40 extensionList_ : null, | 40 */ |
41 extensionList_: null, | |
42 | |
43 get defaultsList() { | |
44 return this.defaultsList_; | |
45 }, | |
46 | |
47 get othersList() { | |
48 return this.othersList_; | |
49 }, | |
50 | |
51 get extensionList() { | |
52 return this.extensionList_; | |
53 }, | |
41 | 54 |
42 /** inheritDoc */ | 55 /** inheritDoc */ |
43 initializePage: function() { | 56 initializePage: function() { |
44 OptionsPage.prototype.initializePage.call(this); | 57 OptionsPage.prototype.initializePage.call(this); |
45 | 58 |
46 this.defaultsList_ = $('default-search-engine-list'); | 59 this.defaultsList_ = $('default-search-engine-list'); |
47 this.setUpList_(this.defaultsList_); | 60 this.setUpList_(this.defaultsList_); |
48 | 61 |
49 this.othersList_ = $('other-search-engine-list'); | 62 this.othersList_ = $('other-search-engine-list'); |
50 this.setUpList_(this.othersList_); | 63 this.setUpList_(this.othersList_); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 | 118 |
106 SearchEngineManager.updateSearchEngineList = function(defaultEngines, | 119 SearchEngineManager.updateSearchEngineList = function(defaultEngines, |
107 otherEngines, | 120 otherEngines, |
108 keywords) { | 121 keywords) { |
109 SearchEngineManager.getInstance().updateSearchEngineList_(defaultEngines, | 122 SearchEngineManager.getInstance().updateSearchEngineList_(defaultEngines, |
110 otherEngines, | 123 otherEngines, |
111 keywords); | 124 keywords); |
112 }; | 125 }; |
113 | 126 |
114 SearchEngineManager.validityCheckCallback = function(validity, modelIndex) { | 127 SearchEngineManager.validityCheckCallback = function(validity, modelIndex) { |
115 // Forward to both lists; the one without a matching modelIndex will ignore | 128 // Forward to all lists; those without a matching modelIndex will ignore it. |
116 // it. | 129 SearchEngineManager.getInstance().defaultsList.validationComplete( |
117 SearchEngineManager.getInstance().defaultsList_.validationComplete( | |
118 validity, modelIndex); | 130 validity, modelIndex); |
119 SearchEngineManager.getInstance().othersList_.validationComplete( | 131 SearchEngineManager.getInstance().othersList.validationComplete( |
132 validity, modelIndex); | |
133 SearchEngineManager.getInstance().extensionList.validationComplete( | |
120 validity, modelIndex); | 134 validity, modelIndex); |
121 }; | 135 }; |
122 | 136 |
123 // Export | 137 // Export |
124 return { | 138 return { |
125 SearchEngineManager: SearchEngineManager | 139 SearchEngineManager: SearchEngineManager |
126 }; | 140 }; |
127 | 141 |
128 }); | 142 }); |
129 | 143 |
OLD | NEW |