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('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Repository which stores information about the user. Events are dispatched | 9 * Repository which stores information about the user. Events are dispatched |
10 * when the information changes. | 10 * when the information changes. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 /** | 61 /** |
62 * @return {!Array.<string>} Email addresses of the logged in users or | 62 * @return {!Array.<string>} Email addresses of the logged in users or |
63 * empty array if no user is logged in. | 63 * empty array if no user is logged in. |
64 */ | 64 */ |
65 get users() { | 65 get users() { |
66 return this.users_; | 66 return this.users_; |
67 }, | 67 }, |
68 | 68 |
69 /** | 69 /** |
70 * Sets logged in user accounts info. | 70 * Sets logged in user accounts info. |
71 * @param {string} user Currently logged in user (email). | 71 * @param {string} activeUser Active user account (email). |
72 * @param {!Array.<string>} users List of currently logged in accounts. | 72 * @param {!Array.<string>} users List of currently logged in accounts. |
73 */ | 73 */ |
74 setUsers: function(activeUser, users) { | 74 setUsers: function(activeUser, users) { |
75 this.activeUser_ = activeUser; | 75 this.activeUser_ = activeUser; |
76 this.users_ = users || []; | 76 this.users_ = users || []; |
77 cr.dispatchSimpleEvent(this, UserInfo.EventType.USERS_CHANGED); | 77 cr.dispatchSimpleEvent(this, UserInfo.EventType.USERS_CHANGED); |
78 }, | 78 }, |
79 }; | 79 }; |
80 | 80 |
81 return { | 81 return { |
82 UserInfo: UserInfo | 82 UserInfo: UserInfo |
83 }; | 83 }; |
84 }); | 84 }); |
OLD | NEW |