Chromium Code Reviews| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 chrome.send('requestHotwordAvailable'); | 205 chrome.send('requestHotwordAvailable'); |
| 206 | 206 |
| 207 if ($('set-wallpaper')) { | 207 if ($('set-wallpaper')) { |
| 208 $('set-wallpaper').onclick = function(event) { | 208 $('set-wallpaper').onclick = function(event) { |
| 209 chrome.send('openWallpaperManager'); | 209 chrome.send('openWallpaperManager'); |
| 210 chrome.send('coreOptionsUserMetricsAction', | 210 chrome.send('coreOptionsUserMetricsAction', |
| 211 ['Options_OpenWallpaperManager']); | 211 ['Options_OpenWallpaperManager']); |
| 212 }; | 212 }; |
| 213 } | 213 } |
| 214 | 214 |
| 215 if (loadTimeData.getBoolean('profileIsGuest')) { | |
|
Evan Stade
2014/08/19 17:49:13
I think a somewhat cleaner approach would be to ad
Mike Lerman
2014/08/19 20:34:12
I've always taken the approach the "logic" should
Evan Stade
2014/08/19 20:41:15
Visibility is a style, imo, and overall I think CS
| |
| 216 if ($('appearance-section')) { | |
| 217 $('appearance-section').hidden = true; | |
| 218 } | |
| 219 if ($('startup-section')) { | |
| 220 $('startup-section').hidden = true; | |
| 221 } | |
| 222 if ($('searchBox')) { | |
| 223 $('searchBox').hidden = true; | |
| 224 } | |
| 225 } | |
| 226 | |
| 215 $('themes-gallery').onclick = function(event) { | 227 $('themes-gallery').onclick = function(event) { |
| 216 window.open(loadTimeData.getString('themesGalleryURL')); | 228 window.open(loadTimeData.getString('themesGalleryURL')); |
| 217 chrome.send('coreOptionsUserMetricsAction', | 229 chrome.send('coreOptionsUserMetricsAction', |
| 218 ['Options_ThemesGallery']); | 230 ['Options_ThemesGallery']); |
| 219 }; | 231 }; |
| 220 $('themes-reset').onclick = function(event) { | 232 $('themes-reset').onclick = function(event) { |
| 221 chrome.send('themesReset'); | 233 chrome.send('themesReset'); |
| 222 }; | 234 }; |
| 223 | 235 |
| 224 if (loadTimeData.getBoolean('profileIsSupervised')) { | 236 if (loadTimeData.getBoolean('profileIsSupervised')) { |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 $('gpu-mode-reset-restart-button').onclick = function(event) { | 648 $('gpu-mode-reset-restart-button').onclick = function(event) { |
| 637 chrome.send('restartBrowser'); | 649 chrome.send('restartBrowser'); |
| 638 }; | 650 }; |
| 639 updateGpuRestartButton(); | 651 updateGpuRestartButton(); |
| 640 } | 652 } |
| 641 | 653 |
| 642 // Reset profile settings section. | 654 // Reset profile settings section. |
| 643 $('reset-profile-settings').onclick = function(event) { | 655 $('reset-profile-settings').onclick = function(event) { |
| 644 PageManager.showPageByName('resetProfileSettings'); | 656 PageManager.showPageByName('resetProfileSettings'); |
| 645 }; | 657 }; |
| 658 // The Reset Profile Settings feature makes no sense for an off-the-record | |
| 659 // profile (e.g. in Guest mode on Chrome OS), so hide it. | |
| 646 $('reset-profile-settings-section').hidden = | 660 $('reset-profile-settings-section').hidden = |
| 647 !loadTimeData.getBoolean('enableResetProfileSettings'); | 661 loadTimeData.getBoolean('profileIsGuest'); |
| 648 | 662 |
| 649 // Extension controlled UI. | 663 // Extension controlled UI. |
| 650 this.addExtensionControlledBox_('search-section-content', | 664 this.addExtensionControlledBox_('search-section-content', |
| 651 'search-engine-controlled', | 665 'search-engine-controlled', |
| 652 true); | 666 true); |
| 653 this.addExtensionControlledBox_('extension-controlled-container', | 667 this.addExtensionControlledBox_('extension-controlled-container', |
| 654 'homepage-controlled', | 668 'homepage-controlled', |
| 655 true); | 669 true); |
| 656 this.addExtensionControlledBox_('startup-section-content', | 670 this.addExtensionControlledBox_('startup-section-content', |
| 657 'startpage-controlled', | 671 'startpage-controlled', |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1956 BrowserOptions.getLoggedInUsername = function() { | 1970 BrowserOptions.getLoggedInUsername = function() { |
| 1957 return BrowserOptions.getInstance().username_; | 1971 return BrowserOptions.getInstance().username_; |
| 1958 }; | 1972 }; |
| 1959 } | 1973 } |
| 1960 | 1974 |
| 1961 // Export | 1975 // Export |
| 1962 return { | 1976 return { |
| 1963 BrowserOptions: BrowserOptions | 1977 BrowserOptions: BrowserOptions |
| 1964 }; | 1978 }; |
| 1965 }); | 1979 }); |
| OLD | NEW |