| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 if (a.onCurrentDevice != b.onCurrentDevice) | 70 if (a.onCurrentDevice != b.onCurrentDevice) |
| 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 |
| 81 this.async(function() { |
| 82 this.$$('paper-listbox').focus(); |
| 83 }.bind(this)); |
| 80 }, | 84 }, |
| 81 | 85 |
| 82 /** | 86 /** |
| 83 * Computed binding that returns the appropriate import message depending on | 87 * Computed binding that returns the appropriate import message depending on |
| 84 * whether or not there are any supervised users to import. | 88 * whether or not there are any supervised users to import. |
| 85 * @param {!Array<!SupervisedUser>} supervisedUsers | 89 * @param {!Array<!SupervisedUser>} supervisedUsers |
| 86 * @private | 90 * @private |
| 87 * @return {string} | 91 * @return {string} |
| 88 */ | 92 */ |
| 89 getMessage_: function(supervisedUsers) { | 93 getMessage_: function(supervisedUsers) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 117 var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_]; | 121 var supervisedUser = this.supervisedUsers_[this.supervisedUserIndex_]; |
| 118 if (this.signedInUser_ && supervisedUser) { | 122 if (this.signedInUser_ && supervisedUser) { |
| 119 this.popupHidden_ = true; | 123 this.popupHidden_ = true; |
| 120 // Event is caught by create-profile. | 124 // Event is caught by create-profile. |
| 121 this.fire('import', {supervisedUser: supervisedUser, | 125 this.fire('import', {supervisedUser: supervisedUser, |
| 122 signedInUser: this.signedInUser_}); | 126 signedInUser: this.signedInUser_}); |
| 123 } | 127 } |
| 124 } | 128 } |
| 125 }); | 129 }); |
| 126 })(); | 130 })(); |
| OLD | NEW |