| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 6 /** |
| 7 * SupervisedUserListData class. | 7 * SupervisedUserListData class. |
| 8 * Handles requests for retrieving a list of existing supervised users which | 8 * Handles requests for retrieving a list of existing supervised users which |
| 9 * are supervised by the current profile. For each request a promise is | 9 * are supervised by the current profile. For each request a promise is |
| 10 * returned, which is cached in order to reuse the retrieved supervised users | 10 * returned, which is cached in order to reuse the retrieved supervised users |
| 11 * for future requests. The first request will be handled asynchronously. | 11 * for future requests. The first request will be handled asynchronously. |
| 12 * @constructor | 12 * @constructor |
| 13 * @class | 13 * @class |
| 14 */ | 14 */ |
| 15 function SupervisedUserListData() { | 15 function SupervisedUserListData() { |
| 16 this.observers_ = []; | 16 this.observers_ = []; |
| 17 }; | 17 } |
| 18 | 18 |
| 19 cr.addSingletonGetter(SupervisedUserListData); | 19 cr.addSingletonGetter(SupervisedUserListData); |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Receives a list of supervised users and resolves the promise. | 22 * Receives a list of supervised users and resolves the promise. |
| 23 * @param {Array<Object>} supervisedUsers Array of supervised user objects. | 23 * @param {Array<Object>} supervisedUsers Array of supervised user objects. |
| 24 * Each object is of the form: | 24 * Each object is of the form: |
| 25 * supervisedUser = { | 25 * supervisedUser = { |
| 26 * id: "Supervised User ID", | 26 * id: "Supervised User ID", |
| 27 * name: "Supervised User Name", | 27 * name: "Supervised User Name", |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 'removeObserver', | 141 'removeObserver', |
| 142 'requestExistingSupervisedUsers', | 142 'requestExistingSupervisedUsers', |
| 143 'resetPromise', | 143 'resetPromise', |
| 144 ]); | 144 ]); |
| 145 | 145 |
| 146 // Export | 146 // Export |
| 147 return { | 147 return { |
| 148 SupervisedUserListData: SupervisedUserListData, | 148 SupervisedUserListData: SupervisedUserListData, |
| 149 }; | 149 }; |
| 150 }); | 150 }); |
| OLD | NEW |