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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 openUrlInLastActiveProfileBrowser: function(url) { | 111 openUrlInLastActiveProfileBrowser: function(url) { |
112 assertNotReached(); | 112 assertNotReached(); |
113 }, | 113 }, |
114 | 114 |
115 /** | 115 /** |
116 * Switches to the profile with the given path. | 116 * Switches to the profile with the given path. |
117 * @param {string} profilePath Path to the profile to switch to. | 117 * @param {string} profilePath Path to the profile to switch to. |
118 */ | 118 */ |
119 switchToProfile: function(profilePath) { | 119 switchToProfile: function(profilePath) { |
120 assertNotReached(); | 120 assertNotReached(); |
121 }, | |
122 | |
123 /** | |
124 * Returns a Promise that is resolved with a true value if at all | |
125 * (non-supervised and non-child) profiles are locked. | |
126 * @return {Promise} | |
dpapad
2016/05/31 21:05:51
The type annotation can be more specific, and also
Moe
2016/05/31 22:14:05
Done.
| |
127 */ | |
128 areAllProfilesLocked: function() { | |
129 assertNotReached(); | |
121 } | 130 } |
122 }; | 131 }; |
123 | 132 |
124 /** | 133 /** |
125 * @constructor | 134 * @constructor |
126 * @implements {signin.ProfileBrowserProxy} | 135 * @implements {signin.ProfileBrowserProxy} |
127 */ | 136 */ |
128 function ProfileBrowserProxyImpl() {} | 137 function ProfileBrowserProxyImpl() {} |
129 | 138 |
130 // The singleton instance_ is replaced with a test version of this wrapper | 139 // 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 }, | 185 }, |
177 | 186 |
178 /** @override */ | 187 /** @override */ |
179 openUrlInLastActiveProfileBrowser: function(url) { | 188 openUrlInLastActiveProfileBrowser: function(url) { |
180 chrome.send('openUrlInLastActiveProfileBrowser', [url]); | 189 chrome.send('openUrlInLastActiveProfileBrowser', [url]); |
181 }, | 190 }, |
182 | 191 |
183 /** @override */ | 192 /** @override */ |
184 switchToProfile: function(profilePath) { | 193 switchToProfile: function(profilePath) { |
185 chrome.send('switchToProfile', [profilePath]); | 194 chrome.send('switchToProfile', [profilePath]); |
195 }, | |
196 | |
197 /** @override */ | |
198 areAllProfilesLocked: function() { | |
199 return cr.sendWithPromise('areAllProfilesLocked'); | |
186 } | 200 } |
187 }; | 201 }; |
188 | 202 |
189 return { | 203 return { |
190 ProfileBrowserProxy: ProfileBrowserProxy, | 204 ProfileBrowserProxy: ProfileBrowserProxy, |
191 ProfileBrowserProxyImpl: ProfileBrowserProxyImpl, | 205 ProfileBrowserProxyImpl: ProfileBrowserProxyImpl, |
192 }; | 206 }; |
193 }); | 207 }); |
OLD | NEW |