| 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 'import-supervised-user' is a popup that allows user to select | 6 * @fileoverview 'import-supervised-user' is a popup that allows user to select |
| 7 * a supervised profile from a list of profiles to import on the current device. | 7 * a supervised profile from a list of profiles to import on the current device. |
| 8 */ | 8 */ |
| 9 (function() { | 9 (function() { |
| 10 /** | 10 /** |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return a.onCurrentDevice ? 1 : -1; | 71 return a.onCurrentDevice ? 1 : -1; |
| 72 return a.name.localeCompare(b.name); | 72 return a.name.localeCompare(b.name); |
| 73 }); | 73 }); |
| 74 | 74 |
| 75 this.supervisedUserIndex_ = NO_USER_SELECTED; | 75 this.supervisedUserIndex_ = NO_USER_SELECTED; |
| 76 | 76 |
| 77 this.signedInUser_ = signedInUser || null; | 77 this.signedInUser_ = signedInUser || null; |
| 78 if (this.signedInUser_) | 78 if (this.signedInUser_) |
| 79 this.popupHidden_ = false; | 79 this.popupHidden_ = false; |
| 80 | 80 |
| 81 if (this.popupHidden_) |
| 82 return; |
| 83 |
| 81 this.async(function() { | 84 this.async(function() { |
| 82 this.$$('paper-listbox').focus(); | 85 this.$$('paper-listbox').focus(); |
| 83 }.bind(this)); | 86 }.bind(this)); |
| 84 }, | 87 }, |
| 85 | 88 |
| 86 /** | 89 /** |
| 87 * Computed binding that returns the appropriate import message depending on | 90 * Computed binding that returns the appropriate import message depending on |
| 88 * whether or not there are any supervised users to import. | 91 * whether or not there are any supervised users to import. |
| 89 * @param {!Array<!SupervisedUser>} supervisedUsers | 92 * @param {!Array<!SupervisedUser>} supervisedUsers |
| 90 * @private | 93 * @private |
| (...skipping 30 matching lines...) Expand all Loading... |
| 121 var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_]; | 124 var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_]; |
| 122 if (this.signedInUser_ && supervisedUser) { | 125 if (this.signedInUser_ && supervisedUser) { |
| 123 this.popupHidden_ = true; | 126 this.popupHidden_ = true; |
| 124 // Event is caught by create-profile. | 127 // Event is caught by create-profile. |
| 125 this.fire('import', {supervisedUser: supervisedUser, | 128 this.fire('import', {supervisedUser: supervisedUser, |
| 126 signedInUser: this.signedInUser_}); | 129 signedInUser: this.signedInUser_}); |
| 127 } | 130 } |
| 128 } | 131 } |
| 129 }); | 132 }); |
| 130 })(); | 133 })(); |
| OLD | NEW |