| 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 * |
| 9 * @element create-profile |
| 8 */ | 10 */ |
| 9 Polymer({ | 11 Polymer({ |
| 10 is: 'create-profile', | 12 is: 'create-profile', |
| 11 | 13 |
| 12 behaviors: [ | 14 behaviors: [WebUIListenerBehavior], |
| 13 I18nBehavior, | |
| 14 WebUIListenerBehavior | |
| 15 ], | |
| 16 | 15 |
| 17 properties: { | 16 properties: { |
| 18 /** | 17 /** |
| 19 * True if supervised user checkbox is disabled. | 18 * True if supervised user checkbox is disabled. |
| 20 * @private {boolean} | 19 * @private {boolean} |
| 21 */ | 20 */ |
| 22 supervisedUserCheckboxDisabled_: { | 21 supervisedUserCheckboxDisabled_: { |
| 23 type: Boolean, | 22 type: Boolean, |
| 24 computed: | 23 computed: |
| 25 'isSupervisedUserCheckboxDisabled_(createInProgress_, signedIn_)' | 24 'isSupervisedUserCheckboxDisabled_(createInProgress_, signedIn_)' |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 this.signedInUsers_ = signedInUsers; | 158 this.signedInUsers_ = signedInUsers; |
| 160 this.signedIn_ = signedInUsers.length > 0; | 159 this.signedIn_ = signedInUsers.length > 0; |
| 161 }, | 160 }, |
| 162 | 161 |
| 163 /** | 162 /** |
| 164 * Handler for the 'Learn More' button click event. | 163 * Handler for the 'Learn More' button click event. |
| 165 * @param {!Event} event | 164 * @param {!Event} event |
| 166 * @private | 165 * @private |
| 167 */ | 166 */ |
| 168 onLearnMoreTap_: function(event) { | 167 onLearnMoreTap_: function(event) { |
| 169 this.fire('change-page', {page: 'supervised-learn-more-page'}); | 168 // TODO(mahmadi): fire the event to show the 'learn-more-page' |
| 170 }, | 169 }, |
| 171 | 170 |
| 172 /** | 171 /** |
| 173 * Handler for the 'Ok' button click event. | 172 * Handler for the 'Ok' button click event. |
| 174 * @param {!Event} event | 173 * @param {!Event} event |
| 175 * @private | 174 * @private |
| 176 */ | 175 */ |
| 177 onSaveTap_: function(event) { | 176 onSaveTap_: function(event) { |
| 178 this.createInProgress_ = true; | 177 this.createInProgress_ = true; |
| 179 this.browserProxy_.createProfile( | 178 this.browserProxy_.createProfile( |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 * Computed binding determining whether supervised user checkbox is disabled. | 264 * Computed binding determining whether supervised user checkbox is disabled. |
| 266 * @param {boolean} createInProgress Is create in progress? | 265 * @param {boolean} createInProgress Is create in progress? |
| 267 * @param {boolean} signedIn Are there any signed-in users? | 266 * @param {boolean} signedIn Are there any signed-in users? |
| 268 * @return {boolean} | 267 * @return {boolean} |
| 269 * @private | 268 * @private |
| 270 */ | 269 */ |
| 271 isSupervisedUserCheckboxDisabled_: function(createInProgress, signedIn) { | 270 isSupervisedUserCheckboxDisabled_: function(createInProgress, signedIn) { |
| 272 return createInProgress || !signedIn; | 271 return createInProgress || !signedIn; |
| 273 } | 272 } |
| 274 }); | 273 }); |
| OLD | NEW |