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 /** | 5 /** |
6 * @fileoverview This file contains methods that allow to tweak | 6 * @fileoverview This file contains methods that allow to tweak |
7 * internal page UI based on the status of current user (owner/user/guest). | 7 * internal page UI based on the status of current user (owner/user/guest). |
8 * It is assumed that required data is passed via i18n strings | 8 * It is assumed that required data is passed via i18n strings |
9 * (using loadTimeData dictionary) that are filled with call to | 9 * (using loadTimeData dictionary) that are filled with call to |
10 * AddAccountUITweaksLocalizedValues in ui_account_tweaks.cc. | 10 * AddAccountUITweaksLocalizedValues in ui_account_tweaks.cc. |
(...skipping 21 matching lines...) Expand all Loading... |
32 }; | 32 }; |
33 | 33 |
34 /** | 34 /** |
35 * @return {boolean} Whether we're currently in guest mode. | 35 * @return {boolean} Whether we're currently in guest mode. |
36 */ | 36 */ |
37 UIAccountTweaks.loggedInAsGuest = function() { | 37 UIAccountTweaks.loggedInAsGuest = function() { |
38 return loadTimeData.getBoolean('loggedInAsGuest'); | 38 return loadTimeData.getBoolean('loggedInAsGuest'); |
39 }; | 39 }; |
40 | 40 |
41 /** | 41 /** |
| 42 * @return {boolean} Whether we're currently in supervised user mode. |
| 43 */ |
| 44 UIAccountTweaks.loggedInAsLocallyManagedUser = function() { |
| 45 return loadTimeData.getBoolean('loggedInAsLocallyManagedUser'); |
| 46 }; |
| 47 |
| 48 /** |
42 * Disables or hides some elements in Guest mode in ChromeOS. | 49 * Disables or hides some elements in Guest mode in ChromeOS. |
43 * All elements within given document with guest-visibility | 50 * All elements within given document with guest-visibility |
44 * attribute are either hidden (for guest-visibility="hidden") | 51 * attribute are either hidden (for guest-visibility="hidden") |
45 * or disabled (for guest-visibility="disabled"). | 52 * or disabled (for guest-visibility="disabled"). |
46 * | 53 * |
47 * @param {Document} document Document that should processed. | 54 * @param {Document} document Document that should processed. |
48 */ | 55 */ |
49 UIAccountTweaks.applyGuestModeVisibility = function(document) { | 56 UIAccountTweaks.applyGuestModeVisibility = function(document) { |
50 if (!cr.isChromeOS || !UIAccountTweaks.loggedInAsGuest()) | 57 if (!cr.isChromeOS || !UIAccountTweaks.loggedInAsGuest()) |
51 return; | 58 return; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 }; | 113 }; |
107 } | 114 } |
108 }; | 115 }; |
109 | 116 |
110 // Export | 117 // Export |
111 return { | 118 return { |
112 UIAccountTweaks: UIAccountTweaks | 119 UIAccountTweaks: UIAccountTweaks |
113 }; | 120 }; |
114 | 121 |
115 }); | 122 }); |
OLD | NEW |