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 Page = cr.ui.pageManager.Page; | 7 var Page = cr.ui.pageManager.Page; |
8 var PageManager = cr.ui.pageManager.PageManager; | 8 var PageManager = cr.ui.pageManager.PageManager; |
9 var ArrayDataModel = cr.ui.ArrayDataModel; | 9 var ArrayDataModel = cr.ui.ArrayDataModel; |
10 var RepeatingButton = cr.ui.RepeatingButton; | 10 var RepeatingButton = cr.ui.RepeatingButton; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 chrome.send('requestHotwordAvailable'); | 213 chrome.send('requestHotwordAvailable'); |
214 | 214 |
215 if ($('set-wallpaper')) { | 215 if ($('set-wallpaper')) { |
216 $('set-wallpaper').onclick = function(event) { | 216 $('set-wallpaper').onclick = function(event) { |
217 chrome.send('openWallpaperManager'); | 217 chrome.send('openWallpaperManager'); |
218 chrome.send('coreOptionsUserMetricsAction', | 218 chrome.send('coreOptionsUserMetricsAction', |
219 ['Options_OpenWallpaperManager']); | 219 ['Options_OpenWallpaperManager']); |
220 }; | 220 }; |
221 } | 221 } |
222 | 222 |
| 223 if (loadTimeData.getBoolean('profileIsGuest')) { |
| 224 if ($('appearance-section')) { |
| 225 $('appearance-section').hidden = true; |
| 226 } |
| 227 if ($('startup-section')) { |
| 228 $('startup-section').hidden = true; |
| 229 } |
| 230 if ($('searchBox')) { |
| 231 $('searchBox').hidden = true; |
| 232 } |
| 233 } |
| 234 |
223 $('themes-gallery').onclick = function(event) { | 235 $('themes-gallery').onclick = function(event) { |
224 window.open(loadTimeData.getString('themesGalleryURL')); | 236 window.open(loadTimeData.getString('themesGalleryURL')); |
225 chrome.send('coreOptionsUserMetricsAction', | 237 chrome.send('coreOptionsUserMetricsAction', |
226 ['Options_ThemesGallery']); | 238 ['Options_ThemesGallery']); |
227 }; | 239 }; |
228 $('themes-reset').onclick = function(event) { | 240 $('themes-reset').onclick = function(event) { |
229 chrome.send('themesReset'); | 241 chrome.send('themesReset'); |
230 }; | 242 }; |
231 | 243 |
232 if (loadTimeData.getBoolean('profileIsSupervised')) { | 244 if (loadTimeData.getBoolean('profileIsSupervised')) { |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 $('gpu-mode-reset-restart-button').onclick = function(event) { | 656 $('gpu-mode-reset-restart-button').onclick = function(event) { |
645 chrome.send('restartBrowser'); | 657 chrome.send('restartBrowser'); |
646 }; | 658 }; |
647 updateGpuRestartButton(); | 659 updateGpuRestartButton(); |
648 } | 660 } |
649 | 661 |
650 // Reset profile settings section. | 662 // Reset profile settings section. |
651 $('reset-profile-settings').onclick = function(event) { | 663 $('reset-profile-settings').onclick = function(event) { |
652 PageManager.showPageByName('resetProfileSettings'); | 664 PageManager.showPageByName('resetProfileSettings'); |
653 }; | 665 }; |
| 666 // The Reset Profile Settings feature makes no sense for an off-the-record |
| 667 // profile (e.g. in Guest mode on Chrome OS), so hide it. |
654 $('reset-profile-settings-section').hidden = | 668 $('reset-profile-settings-section').hidden = |
655 !loadTimeData.getBoolean('enableResetProfileSettings'); | 669 loadTimeData.getBoolean('profileIsGuest'); |
656 | 670 |
657 // Extension controlled UI. | 671 // Extension controlled UI. |
658 this.addExtensionControlledBox_('search-section-content', | 672 this.addExtensionControlledBox_('search-section-content', |
659 'search-engine-controlled', | 673 'search-engine-controlled', |
660 true); | 674 true); |
661 this.addExtensionControlledBox_('extension-controlled-container', | 675 this.addExtensionControlledBox_('extension-controlled-container', |
662 'homepage-controlled', | 676 'homepage-controlled', |
663 true); | 677 true); |
664 this.addExtensionControlledBox_('startup-section-content', | 678 this.addExtensionControlledBox_('startup-section-content', |
665 'startpage-controlled', | 679 'startpage-controlled', |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1980 BrowserOptions.getLoggedInUsername = function() { | 1994 BrowserOptions.getLoggedInUsername = function() { |
1981 return BrowserOptions.getInstance().username_; | 1995 return BrowserOptions.getInstance().username_; |
1982 }; | 1996 }; |
1983 } | 1997 } |
1984 | 1998 |
1985 // Export | 1999 // Export |
1986 return { | 2000 return { |
1987 BrowserOptions: BrowserOptions | 2001 BrowserOptions: BrowserOptions |
1988 }; | 2002 }; |
1989 }); | 2003 }); |
OLD | NEW |