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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 OptionsPage.navigateToPage('accounts'); | 228 OptionsPage.navigateToPage('accounts'); |
229 chrome.send('coreOptionsUserMetricsAction', | 229 chrome.send('coreOptionsUserMetricsAction', |
230 ['Options_ManageAccounts']); | 230 ['Options_ManageAccounts']); |
231 }; | 231 }; |
232 } else { | 232 } else { |
233 $('import-data').onclick = function(event) { | 233 $('import-data').onclick = function(event) { |
234 ImportDataOverlay.show(); | 234 ImportDataOverlay.show(); |
235 chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']); | 235 chrome.send('coreOptionsUserMetricsAction', ['Import_ShowDlg']); |
236 }; | 236 }; |
237 | 237 |
238 if ($('themes-GTK-button')) { | 238 if ($('themes-Native-button')) { |
239 $('themes-GTK-button').onclick = function(event) { | 239 $('themes-Native-button').onclick = function(event) { |
240 chrome.send('themesSetGTK'); | 240 chrome.send('themesSetNative'); |
241 }; | 241 }; |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 // Default browser section. | 245 // Default browser section. |
246 if (!cr.isChromeOS) { | 246 if (!cr.isChromeOS) { |
247 $('set-as-default-browser').onclick = function(event) { | 247 $('set-as-default-browser').onclick = function(event) { |
248 chrome.send('becomeDefaultBrowser'); | 248 chrome.send('becomeDefaultBrowser'); |
249 }; | 249 }; |
250 | 250 |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1107 for (var i = 0; i < $('profiles-list').dataModel.length; i++) { | 1107 for (var i = 0; i < $('profiles-list').dataModel.length; i++) { |
1108 var profile = $('profiles-list').dataModel.item(i); | 1108 var profile = $('profiles-list').dataModel.item(i); |
1109 if (profile.isCurrentProfile) | 1109 if (profile.isCurrentProfile) |
1110 return profile; | 1110 return profile; |
1111 } | 1111 } |
1112 | 1112 |
1113 assert(false, | 1113 assert(false, |
1114 'There should always be a current profile, but none found.'); | 1114 'There should always be a current profile, but none found.'); |
1115 }, | 1115 }, |
1116 | 1116 |
1117 setGtkThemeButtonEnabled_: function(enabled) { | 1117 setNativeThemeButtonEnabled_: function(enabled) { |
1118 if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i)) | 1118 if (!cr.isChromeOS && navigator.platform.match(/linux|BSD/i)) |
Evan Stade
2013/06/20 22:24:35
can we just check if the button exists here instea
Elliot Glaysher
2013/06/21 17:58:45
I am not good with Javascript. Is this what you wa
Evan Stade
2013/06/21 21:40:52
yes
| |
1119 $('themes-GTK-button').disabled = !enabled; | 1119 $('themes-Native-button').disabled = !enabled; |
1120 }, | 1120 }, |
1121 | 1121 |
1122 setThemesResetButtonEnabled_: function(enabled) { | 1122 setThemesResetButtonEnabled_: function(enabled) { |
1123 $('themes-reset').disabled = !enabled; | 1123 $('themes-reset').disabled = !enabled; |
1124 }, | 1124 }, |
1125 | 1125 |
1126 /** | 1126 /** |
1127 * (Re)loads IMG element with current user account picture. | 1127 * (Re)loads IMG element with current user account picture. |
1128 * @private | 1128 * @private |
1129 */ | 1129 */ |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1458 'getCurrentProfile', | 1458 'getCurrentProfile', |
1459 'getStartStopSyncButton', | 1459 'getStartStopSyncButton', |
1460 'hideBluetoothSettings', | 1460 'hideBluetoothSettings', |
1461 'notifyInitializationComplete', | 1461 'notifyInitializationComplete', |
1462 'removeBluetoothDevice', | 1462 'removeBluetoothDevice', |
1463 'removeCloudPrintConnectorSection', | 1463 'removeCloudPrintConnectorSection', |
1464 'scrollToSection', | 1464 'scrollToSection', |
1465 'setAutoOpenFileTypesDisplayed', | 1465 'setAutoOpenFileTypesDisplayed', |
1466 'setBluetoothState', | 1466 'setBluetoothState', |
1467 'setFontSize', | 1467 'setFontSize', |
1468 'setGtkThemeButtonEnabled', | 1468 'setNativeThemeButtonEnabled', |
1469 'setHighContrastCheckboxState', | 1469 'setHighContrastCheckboxState', |
1470 'setMetricsReportingCheckboxState', | 1470 'setMetricsReportingCheckboxState', |
1471 'setMetricsReportingSettingVisibility', | 1471 'setMetricsReportingSettingVisibility', |
1472 'setPasswordGenerationSettingVisibility', | 1472 'setPasswordGenerationSettingVisibility', |
1473 'setProfilesInfo', | 1473 'setProfilesInfo', |
1474 'setSpokenFeedbackCheckboxState', | 1474 'setSpokenFeedbackCheckboxState', |
1475 'setThemesResetButtonEnabled', | 1475 'setThemesResetButtonEnabled', |
1476 'setVirtualKeyboardCheckboxState', | 1476 'setVirtualKeyboardCheckboxState', |
1477 'setupCloudPrintConnectorSection', | 1477 'setupCloudPrintConnectorSection', |
1478 'setupPageZoomSelector', | 1478 'setupPageZoomSelector', |
(...skipping 27 matching lines...) Expand all Loading... | |
1506 BrowserOptions.getLoggedInUsername = function() { | 1506 BrowserOptions.getLoggedInUsername = function() { |
1507 return BrowserOptions.getInstance().username_; | 1507 return BrowserOptions.getInstance().username_; |
1508 }; | 1508 }; |
1509 } | 1509 } |
1510 | 1510 |
1511 // Export | 1511 // Export |
1512 return { | 1512 return { |
1513 BrowserOptions: BrowserOptions | 1513 BrowserOptions: BrowserOptions |
1514 }; | 1514 }; |
1515 }); | 1515 }); |
OLD | NEW |