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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 $('advanced-settings-expander').onclick = function() { | 69 $('advanced-settings-expander').onclick = function() { |
70 self.toggleSectionWithAnimation_( | 70 self.toggleSectionWithAnimation_( |
71 $('advanced-settings'), | 71 $('advanced-settings'), |
72 $('advanced-settings-container')); | 72 $('advanced-settings-container')); |
73 } | 73 } |
74 $('advanced-settings').addEventListener('webkitTransitionEnd', | 74 $('advanced-settings').addEventListener('webkitTransitionEnd', |
75 this.updateAdvancedSettingsExpander_.bind(this)); | 75 this.updateAdvancedSettingsExpander_.bind(this)); |
76 | 76 |
77 if (cr.isChromeOS) | 77 if (cr.isChromeOS) |
78 AccountsOptions.applyGuestModeVisibility(document); | 78 UIAccountTweaks.applyGuestModeVisibility(document); |
79 | 79 |
80 // Sync (Sign in) section. | 80 // Sync (Sign in) section. |
81 this.updateSyncState_(templateData.syncData); | 81 this.updateSyncState_(templateData.syncData); |
82 | 82 |
83 $('sync-action-link').onclick = function(event) { | 83 $('sync-action-link').onclick = function(event) { |
84 SyncSetupOverlay.showErrorUI(); | 84 SyncSetupOverlay.showErrorUI(); |
85 }; | 85 }; |
86 $('start-stop-sync').onclick = function(event) { | 86 $('start-stop-sync').onclick = function(event) { |
87 if (self.syncSetupCompleted) | 87 if (self.syncSetupCompleted) |
88 SyncSetupOverlay.showStopSyncingUI(); | 88 SyncSetupOverlay.showStopSyncingUI(); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 if (selectedProfile) | 215 if (selectedProfile) |
216 ManageProfileOverlay.showManageDialog(selectedProfile); | 216 ManageProfileOverlay.showManageDialog(selectedProfile); |
217 }; | 217 }; |
218 $('profiles-delete').onclick = function(event) { | 218 $('profiles-delete').onclick = function(event) { |
219 var selectedProfile = self.getSelectedProfileItem_(); | 219 var selectedProfile = self.getSelectedProfileItem_(); |
220 if (selectedProfile) | 220 if (selectedProfile) |
221 ManageProfileOverlay.showDeleteDialog(selectedProfile); | 221 ManageProfileOverlay.showDeleteDialog(selectedProfile); |
222 }; | 222 }; |
223 | 223 |
224 if (cr.isChromeOS) { | 224 if (cr.isChromeOS) { |
225 if (!AccountsOptions.loggedInAsGuest()) { | 225 if (!UIAccountTweaks.loggedInAsGuest()) { |
226 $('account-picture-wrapper').onclick = function(event) { | 226 $('account-picture-wrapper').onclick = function(event) { |
227 OptionsPage.navigateToPage('changePicture'); | 227 OptionsPage.navigateToPage('changePicture'); |
228 }; | 228 }; |
229 } | 229 } |
230 | 230 |
231 // Username (canonical email) of the currently logged in user or | 231 // Username (canonical email) of the currently logged in user or |
232 // |kGuestUser| if a guest session is active. | 232 // |kGuestUser| if a guest session is active. |
233 this.username_ = localStrings.getString('username'); | 233 this.username_ = localStrings.getString('username'); |
234 | 234 |
235 this.updateAccountPicture_(); | 235 this.updateAccountPicture_(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 OptionsPage.navigateToPage('autofill'); | 320 OptionsPage.navigateToPage('autofill'); |
321 chrome.send('coreOptionsUserMetricsAction', | 321 chrome.send('coreOptionsUserMetricsAction', |
322 ['Options_ShowAutofillSettings']); | 322 ['Options_ShowAutofillSettings']); |
323 }; | 323 }; |
324 $('manage-passwords').onclick = function(event) { | 324 $('manage-passwords').onclick = function(event) { |
325 OptionsPage.navigateToPage('passwords'); | 325 OptionsPage.navigateToPage('passwords'); |
326 OptionsPage.showTab($('passwords-nav-tab')); | 326 OptionsPage.showTab($('passwords-nav-tab')); |
327 chrome.send('coreOptionsUserMetricsAction', | 327 chrome.send('coreOptionsUserMetricsAction', |
328 ['Options_ShowPasswordManager']); | 328 ['Options_ShowPasswordManager']); |
329 }; | 329 }; |
330 if (cr.isChromeOS && AccountsOptions.loggedInAsGuest()) { | 330 if (cr.isChromeOS && UIAccountTweaks.loggedInAsGuest()) { |
331 // Disable and turn off Autofill in guest mode. | 331 // Disable and turn off Autofill in guest mode. |
332 var autofillEnabled = $('autofill-enabled'); | 332 var autofillEnabled = $('autofill-enabled'); |
333 autofillEnabled.disabled = true; | 333 autofillEnabled.disabled = true; |
334 autofillEnabled.checked = false; | 334 autofillEnabled.checked = false; |
335 cr.dispatchSimpleEvent(autofillEnabled, 'change'); | 335 cr.dispatchSimpleEvent(autofillEnabled, 'change'); |
336 $('autofill-settings').disabled = true; | 336 $('autofill-settings').disabled = true; |
337 | 337 |
338 // Disable and turn off Password Manager in guest mode. | 338 // Disable and turn off Password Manager in guest mode. |
339 var passwordManagerEnabled = $('password-manager-enabled'); | 339 var passwordManagerEnabled = $('password-manager-enabled'); |
340 passwordManagerEnabled.disabled = true; | 340 passwordManagerEnabled.disabled = true; |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 | 764 |
765 /** | 765 /** |
766 * Displays the session restore info dialog if options depending on sessions | 766 * Displays the session restore info dialog if options depending on sessions |
767 * (session only cookies or clearning data on exit) are selected, and the | 767 * (session only cookies or clearning data on exit) are selected, and the |
768 * dialog has never been shown. | 768 * dialog has never been shown. |
769 * @private | 769 * @private |
770 * @return {boolean} True if the dialog is shown, false otherwise. | 770 * @return {boolean} True if the dialog is shown, false otherwise. |
771 */ | 771 */ |
772 maybeShowSessionRestoreDialog_: function() { | 772 maybeShowSessionRestoreDialog_: function() { |
773 // Don't show this dialog in Guest mode. | 773 // Don't show this dialog in Guest mode. |
774 if (cr.isChromeOS && AccountsOptions.loggedInAsGuest()) | 774 if (cr.isChromeOS && UIAccountTweaks.loggedInAsGuest()) |
775 return false; | 775 return false; |
776 // If some of the needed preferences haven't been read yet, the | 776 // If some of the needed preferences haven't been read yet, the |
777 // corresponding member variable will be undefined and we won't display | 777 // corresponding member variable will be undefined and we won't display |
778 // the dialog yet. | 778 // the dialog yet. |
779 if (this.userHasSelectedSessionContentSettings_() && | 779 if (this.userHasSelectedSessionContentSettings_() && |
780 this.sessionRestoreDialogShown_ === false) { | 780 this.sessionRestoreDialogShown_ === false) { |
781 OptionsPage.showPageByName('sessionRestoreOverlay', false); | 781 OptionsPage.showPageByName('sessionRestoreOverlay', false); |
782 return true; | 782 return true; |
783 } | 783 } |
784 return false; | 784 return false; |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 BrowserOptions.getLoggedInUsername = function() { | 1378 BrowserOptions.getLoggedInUsername = function() { |
1379 return BrowserOptions.getInstance().username_; | 1379 return BrowserOptions.getInstance().username_; |
1380 }; | 1380 }; |
1381 } | 1381 } |
1382 | 1382 |
1383 // Export | 1383 // Export |
1384 return { | 1384 return { |
1385 BrowserOptions: BrowserOptions | 1385 BrowserOptions: BrowserOptions |
1386 }; | 1386 }; |
1387 }); | 1387 }); |
OLD | NEW |