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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } | 151 } |
152 | 152 |
153 // Search section. | 153 // Search section. |
154 $('manage-default-search-engines').onclick = function(event) { | 154 $('manage-default-search-engines').onclick = function(event) { |
155 OptionsPage.navigateToPage('searchEngines'); | 155 OptionsPage.navigateToPage('searchEngines'); |
156 chrome.send('coreOptionsUserMetricsAction', | 156 chrome.send('coreOptionsUserMetricsAction', |
157 ['Options_ManageSearchEngines']); | 157 ['Options_ManageSearchEngines']); |
158 }; | 158 }; |
159 $('default-search-engine').addEventListener('change', | 159 $('default-search-engine').addEventListener('change', |
160 this.setDefaultSearchEngine_); | 160 this.setDefaultSearchEngine_); |
| 161 if (loadTimeData.getValue('instant_extended')) { |
| 162 // The control must be duplicated because we can't change the pref |
| 163 // attribute here, it would be too late, since the value is initialized |
| 164 // earlier using the original pref name, so we swap the controls. |
| 165 $('instant-enabled-control').hidden = true; |
| 166 $('instant-extended-enabled-control').hidden = false; |
| 167 // For the other elements, we can simply modify them here as follows. |
| 168 $('instant-enabled-indicator').removeAttribute('dialog-pref'); |
| 169 $('instant-enabled-control').setAttribute('pref', |
| 170 'instant_extended.enabled'); |
| 171 $('instant-enabled-control-label').setAttribute( |
| 172 'for', 'instant-extended-enabled-control'); |
| 173 } |
161 | 174 |
162 // Users section. | 175 // Users section. |
163 if (loadTimeData.valueExists('profilesInfo')) { | 176 if (loadTimeData.valueExists('profilesInfo')) { |
164 $('profiles-section').hidden = false; | 177 $('profiles-section').hidden = false; |
165 | 178 |
166 var profilesList = $('profiles-list'); | 179 var profilesList = $('profiles-list'); |
167 options.browser_options.ProfileList.decorate(profilesList); | 180 options.browser_options.ProfileList.decorate(profilesList); |
168 profilesList.autoExpands = true; | 181 profilesList.autoExpands = true; |
169 | 182 |
170 this.setProfilesInfo_(loadTimeData.getValue('profilesInfo')); | 183 this.setProfilesInfo_(loadTimeData.getValue('profilesInfo')); |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 BrowserOptions.getLoggedInUsername = function() { | 1375 BrowserOptions.getLoggedInUsername = function() { |
1363 return BrowserOptions.getInstance().username_; | 1376 return BrowserOptions.getInstance().username_; |
1364 }; | 1377 }; |
1365 } | 1378 } |
1366 | 1379 |
1367 // Export | 1380 // Export |
1368 return { | 1381 return { |
1369 BrowserOptions: BrowserOptions | 1382 BrowserOptions: BrowserOptions |
1370 }; | 1383 }; |
1371 }); | 1384 }); |
OLD | NEW |