OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Helper object and related behavior that encapsulate messaging | 6 * @fileoverview Helper object and related behavior that encapsulate messaging |
7 * between JS and C++ for creating/importing profiles in the user-manager page. | 7 * between JS and C++ for creating/importing profiles in the user-manager page. |
8 */ | 8 */ |
9 | 9 |
10 /** @typedef {{username: string, profilePath: string}} */ | 10 /** @typedef {{username: string, profilePath: string}} */ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 }, | 47 }, |
48 | 48 |
49 /** | 49 /** |
50 * Launches the guest user. | 50 * Launches the guest user. |
51 */ | 51 */ |
52 launchGuestUser: function() { | 52 launchGuestUser: function() { |
53 assertNotReached(); | 53 assertNotReached(); |
54 }, | 54 }, |
55 | 55 |
56 /** | 56 /** |
57 * Gets the list of existing supervised users. | |
58 * @param {string} profilePath Profile Path of the custodian. | 57 * @param {string} profilePath Profile Path of the custodian. |
59 * @return {Promise} A promise for the requested data. | 58 * @return {!Promise<!Array<!SupervisedUser>>} The list of existing |
60 * @private | 59 * supervised users. |
61 */ | 60 */ |
62 getExistingSupervisedUsers: function(profilePath) { | 61 getExistingSupervisedUsers: function(profilePath) { |
63 assertNotReached(); | 62 assertNotReached(); |
64 }, | 63 }, |
65 | 64 |
66 /** | 65 /** |
67 * Creates a profile. | 66 * Creates a profile. |
68 * @param {string} profileName Name of the new profile. | 67 * @param {string} profileName Name of the new profile. |
69 * @param {string} profileIconUrl URL of the selected icon of the new | 68 * @param {string} profileIconUrl URL of the selected icon of the new |
70 * profile. | 69 * profile. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 openUrlInLastActiveProfileBrowser: function(url) { | 110 openUrlInLastActiveProfileBrowser: function(url) { |
112 assertNotReached(); | 111 assertNotReached(); |
113 }, | 112 }, |
114 | 113 |
115 /** | 114 /** |
116 * Switches to the profile with the given path. | 115 * Switches to the profile with the given path. |
117 * @param {string} profilePath Path to the profile to switch to. | 116 * @param {string} profilePath Path to the profile to switch to. |
118 */ | 117 */ |
119 switchToProfile: function(profilePath) { | 118 switchToProfile: function(profilePath) { |
120 assertNotReached(); | 119 assertNotReached(); |
| 120 }, |
| 121 |
| 122 /** |
| 123 * @return {!Promise<boolean>} Whether all (non-supervised and non-child) |
| 124 * profiles are locked. |
| 125 */ |
| 126 areAllProfilesLocked: function() { |
| 127 assertNotReached(); |
121 } | 128 } |
122 }; | 129 }; |
123 | 130 |
124 /** | 131 /** |
125 * @constructor | 132 * @constructor |
126 * @implements {signin.ProfileBrowserProxy} | 133 * @implements {signin.ProfileBrowserProxy} |
127 */ | 134 */ |
128 function ProfileBrowserProxyImpl() {} | 135 function ProfileBrowserProxyImpl() {} |
129 | 136 |
130 // The singleton instance_ is replaced with a test version of this wrapper | 137 // The singleton instance_ is replaced with a test version of this wrapper |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 }, | 183 }, |
177 | 184 |
178 /** @override */ | 185 /** @override */ |
179 openUrlInLastActiveProfileBrowser: function(url) { | 186 openUrlInLastActiveProfileBrowser: function(url) { |
180 chrome.send('openUrlInLastActiveProfileBrowser', [url]); | 187 chrome.send('openUrlInLastActiveProfileBrowser', [url]); |
181 }, | 188 }, |
182 | 189 |
183 /** @override */ | 190 /** @override */ |
184 switchToProfile: function(profilePath) { | 191 switchToProfile: function(profilePath) { |
185 chrome.send('switchToProfile', [profilePath]); | 192 chrome.send('switchToProfile', [profilePath]); |
| 193 }, |
| 194 |
| 195 /** @override */ |
| 196 areAllProfilesLocked: function() { |
| 197 return cr.sendWithPromise('areAllProfilesLocked'); |
186 } | 198 } |
187 }; | 199 }; |
188 | 200 |
189 return { | 201 return { |
190 ProfileBrowserProxy: ProfileBrowserProxy, | 202 ProfileBrowserProxy: ProfileBrowserProxy, |
191 ProfileBrowserProxyImpl: ProfileBrowserProxyImpl, | 203 ProfileBrowserProxyImpl: ProfileBrowserProxyImpl, |
192 }; | 204 }; |
193 }); | 205 }); |
OLD | NEW |