Chromium Code Reviews| 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 'create-profile' is a page that contains controls for creating | 6 * @fileoverview 'create-profile' is a page that contains controls for creating |
| 7 * a (optionally supervised) profile, including choosing a name, and an avatar. | 7 * a (optionally supervised) profile, including choosing a name, and an avatar. |
| 8 */ | 8 */ |
| 9 (function() { | 9 (function() { |
| 10 /** | 10 /** |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 'profile-icons-received', this.handleProfileIcons_.bind(this)); | 120 'profile-icons-received', this.handleProfileIcons_.bind(this)); |
| 121 this.addWebUIListener( | 121 this.addWebUIListener( |
| 122 'profile-defaults-received', this.handleProfileDefaults_.bind(this)); | 122 'profile-defaults-received', this.handleProfileDefaults_.bind(this)); |
| 123 this.addWebUIListener( | 123 this.addWebUIListener( |
| 124 'signedin-users-received', this.handleSignedInUsers_.bind(this)); | 124 'signedin-users-received', this.handleSignedInUsers_.bind(this)); |
| 125 | 125 |
| 126 this.browserProxy_.getAvailableIcons(); | 126 this.browserProxy_.getAvailableIcons(); |
| 127 this.browserProxy_.getSignedInUsers(); | 127 this.browserProxy_.getSignedInUsers(); |
| 128 | 128 |
| 129 // Alias on 'this' to use in html. | 129 // Alias on 'this' to use in html. |
| 130 this.NO_USER_SELECTED = NO_USER_SELECTED; | 130 this.NO_USER_SELECTED = NO_USER_SELECTED; |
|
dpapad
2016/05/03 17:30:26
Nit: Can this be moved in the properties {} sectio
| |
| 131 }, | 131 }, |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Handles tap events from dynamically created links in warning/error messages | 134 * Handles tap events from: |
| 135 * pushed by the browser. | 135 * - links within dynamic warning/error messages pushed from the browser. |
| 136 * - the 'noSignedInUserMessage' i18n string. | |
| 136 * @param {!Event} event | 137 * @param {!Event} event |
| 137 * @private | 138 * @private |
| 138 */ | 139 */ |
| 139 onTap_: function(event) { | 140 onTap_: function(event) { |
| 140 var element = Polymer.dom(event).rootTarget; | 141 var element = Polymer.dom(event).rootTarget; |
| 141 | 142 |
| 142 if (element.id == 'supervised-user-import-existing') { | 143 if (element.id == 'supervised-user-import-existing') { |
|
dpapad
2016/05/03 17:30:26
I can't find any element with this ID in the HTML?
Moe
2016/05/03 20:30:10
Yes. These are both dynamically added. The comment
| |
| 143 this.onImportUserTap_(event); | 144 this.onImportUserTap_(event); |
| 144 event.preventDefault(); | 145 event.preventDefault(); |
| 146 } else if (element.id == 'sign-in-to-chrome') { | |
|
dpapad
2016/05/03 17:30:26
Same here.
Moe
2016/05/03 20:30:10
Same as above.
| |
| 147 this.browserProxy_.openUrlInLastActiveProfileBrowser(element.href); | |
| 148 event.preventDefault(); | |
| 145 } | 149 } |
| 146 // TODO(mahmadi): handle tap event on '#reauth' to re-auth the custodian. | 150 // TODO(mahmadi): handle tap event on '#reauth' to re-auth the custodian. |
| 147 }, | 151 }, |
| 148 | 152 |
| 149 /** | 153 /** |
| 150 * Handler for when the profile icons are pushed from the browser. | 154 * Handler for when the profile icons are pushed from the browser. |
| 151 * @param {!Array<string>} iconUrls | 155 * @param {!Array<string>} iconUrls |
| 152 * @private | 156 * @private |
| 153 */ | 157 */ |
| 154 handleProfileIcons_: function(iconUrls) { | 158 handleProfileIcons_: function(iconUrls) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 * Computed binding that returns True if there are any signed-in users. | 416 * Computed binding that returns True if there are any signed-in users. |
| 413 * @param {!Array<!SignedInUser>} signedInUsers signed-in users. | 417 * @param {!Array<!SignedInUser>} signedInUsers signed-in users. |
| 414 * @return {boolean} | 418 * @return {boolean} |
| 415 * @private | 419 * @private |
| 416 */ | 420 */ |
| 417 isSignedIn_: function(signedInUsers) { | 421 isSignedIn_: function(signedInUsers) { |
| 418 return signedInUsers.length > 0; | 422 return signedInUsers.length > 0; |
| 419 } | 423 } |
| 420 }); | 424 }); |
| 421 }()); | 425 }()); |
| OLD | NEW |