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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 // Appearance section. | 80 // Appearance section. |
81 $('change-home-page').onclick = function(event) { | 81 $('change-home-page').onclick = function(event) { |
82 OptionsPage.navigateToPage('homePageOverlay'); | 82 OptionsPage.navigateToPage('homePageOverlay'); |
83 }; | 83 }; |
84 $('themes-gallery').onclick = function(event) { | 84 $('themes-gallery').onclick = function(event) { |
85 window.open(localStrings.getString('themesGalleryURL')); | 85 window.open(localStrings.getString('themesGalleryURL')); |
86 }; | 86 }; |
87 $('themes-reset').onclick = function(event) { | 87 $('themes-reset').onclick = function(event) { |
88 chrome.send('themesReset'); | 88 chrome.send('themesReset'); |
89 }; | 89 }; |
90 if (cr.isChromeOS) { | |
91 // // Appearance section. | |
csilv
2012/03/01 01:32:18
nit, extra //
Perhaps we should combine the if bl
Denis Kuznetsov (DE-MUC)
2012/03/01 14:21:54
Done.
I like the idea that all code is grouped ju
| |
92 if (AccountsOptions.loggedInAsGuest()) { | |
93 AccountsOptions.disableElementsForGuest( | |
94 $('toolbar-show-home-button-group')); | |
95 AccountsOptions.disableElementsForGuest( | |
96 $('bookmarkbar-show-on-all-tabs-group')); | |
97 // Search section | |
98 AccountsOptions.disableElementsForGuest($('instant-setting')); | |
99 } | |
100 } | |
90 | 101 |
91 // Device section (ChromeOS only). | 102 // Device section (ChromeOS only). |
92 if (cr.isChromeOS) { | 103 if (cr.isChromeOS) { |
93 $('keyboard-settings-button').onclick = function(evt) { | 104 $('keyboard-settings-button').onclick = function(evt) { |
94 OptionsPage.navigateToPage('keyboard-overlay'); | 105 OptionsPage.navigateToPage('keyboard-overlay'); |
95 }; | 106 }; |
96 $('pointer-settings-button').onclick = function(evt) { | 107 $('pointer-settings-button').onclick = function(evt) { |
97 OptionsPage.navigateToPage('pointer-overlay'); | 108 OptionsPage.navigateToPage('pointer-overlay'); |
98 }; | 109 }; |
99 this.initBrightnessButton_('brightness-decrease-button', | 110 this.initBrightnessButton_('brightness-decrease-button', |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 if (selectedProfile) | 176 if (selectedProfile) |
166 ManageProfileOverlay.showManageDialog(selectedProfile); | 177 ManageProfileOverlay.showManageDialog(selectedProfile); |
167 }; | 178 }; |
168 $('profiles-delete').onclick = function(event) { | 179 $('profiles-delete').onclick = function(event) { |
169 var selectedProfile = self.getSelectedProfileItem_(); | 180 var selectedProfile = self.getSelectedProfileItem_(); |
170 if (selectedProfile) | 181 if (selectedProfile) |
171 ManageProfileOverlay.showDeleteDialog(selectedProfile); | 182 ManageProfileOverlay.showDeleteDialog(selectedProfile); |
172 }; | 183 }; |
173 | 184 |
174 if (cr.isChromeOS) { | 185 if (cr.isChromeOS) { |
186 if (AccountsOptions.loggedInAsGuest()) { | |
187 // Disable the screen lock checkbox in guest mode. | |
188 AccountsOptions.disableElementsForGuest($('enable-screen-lock')); | |
189 | |
190 // Hide the startup and users sections in Guest mode. | |
191 $('startup-section').hidden = true; | |
192 $('users-section').hidden = true; | |
193 } | |
194 | |
175 // Username (canonical email) of the currently logged in user or | 195 // Username (canonical email) of the currently logged in user or |
176 // |kGuestUser| if a guest session is active. | 196 // |kGuestUser| if a guest session is active. |
177 this.username_ = localStrings.getString('username'); | 197 this.username_ = localStrings.getString('username'); |
178 | 198 |
179 $('account-picture-wrapper').onclick = function(event) { | 199 $('account-picture-wrapper').onclick = function(event) { |
180 OptionsPage.navigateToPage('changePicture'); | 200 OptionsPage.navigateToPage('changePicture'); |
181 }; | 201 }; |
182 this.updateAccountPicture_(); | 202 this.updateAccountPicture_(); |
183 | 203 |
184 if (cr.commandLine && cr.commandLine.options['--bwsi']) { | |
185 // Disable the screen lock checkbox and change-picture-button in | |
186 // guest mode. | |
187 $('enable-screen-lock').disabled = true; | |
188 $('change-picture-button').disabled = true; | |
189 | |
190 // Hide the startup section in Guest mode. | |
191 $('startup-section').hidden = true; | |
192 } | |
193 | |
194 $('manage-accounts-button').onclick = function(event) { | 204 $('manage-accounts-button').onclick = function(event) { |
195 OptionsPage.navigateToPage('accounts'); | 205 OptionsPage.navigateToPage('accounts'); |
196 chrome.send('coreOptionsUserMetricsAction', | 206 chrome.send('coreOptionsUserMetricsAction', |
197 ['Options_ManageAccounts']); | 207 ['Options_ManageAccounts']); |
198 }; | 208 }; |
199 } else { | 209 } else { |
200 $('import-data').onclick = function(event) { | 210 $('import-data').onclick = function(event) { |
201 // Make sure that any previous import success message is hidden, and | 211 // Make sure that any previous import success message is hidden, and |
202 // we're showing the UI to import further data. | 212 // we're showing the UI to import further data. |
203 $('import-data-configure').hidden = false; | 213 $('import-data-configure').hidden = false; |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
679 BrowserOptions.getLoggedInUsername = function() { | 689 BrowserOptions.getLoggedInUsername = function() { |
680 return BrowserOptions.getInstance().username_; | 690 return BrowserOptions.getInstance().username_; |
681 }; | 691 }; |
682 } | 692 } |
683 | 693 |
684 // Export | 694 // Export |
685 return { | 695 return { |
686 BrowserOptions: BrowserOptions | 696 BrowserOptions: BrowserOptions |
687 }; | 697 }; |
688 }); | 698 }); |
OLD | NEW |