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('oobe', function() { | 5 cr.define('oobe', function() { |
6 /** | 6 /** |
7 * Creates a new oobe screen div. | 7 * Creates a new oobe screen div. |
8 * @constructor | 8 * @constructor |
9 * @extends {HTMLDivElement} | 9 * @extends {HTMLDivElement} |
10 */ | 10 */ |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 */ | 245 */ |
246 showWorking: function(message) { | 246 showWorking: function(message) { |
247 $('oauth-enroll-working-message').textContent = message; | 247 $('oauth-enroll-working-message').textContent = message; |
248 this.showStep('working'); | 248 this.showStep('working'); |
249 }, | 249 }, |
250 | 250 |
251 /** | 251 /** |
252 * Handler for cancellations of an enforced auto-enrollment. | 252 * Handler for cancellations of an enforced auto-enrollment. |
253 */ | 253 */ |
254 cancelAutoEnrollment: function() { | 254 cancelAutoEnrollment: function() { |
| 255 if (!this.isAutoEnrollment_) |
| 256 return; |
255 if (!this.confirmDialog_) { | 257 if (!this.confirmDialog_) { |
256 this.confirmDialog_ = new cr.ui.dialogs.ConfirmDialog(document.body); | 258 this.confirmDialog_ = new cr.ui.dialogs.ConfirmDialog(document.body); |
257 this.confirmDialog_.setOkLabel( | 259 this.confirmDialog_.setOkLabel( |
258 localStrings.getString('oauthEnrollCancelAutoEnrollmentConfirm')); | 260 localStrings.getString('oauthEnrollCancelAutoEnrollmentConfirm')); |
259 this.confirmDialog_.setCancelLabel( | 261 this.confirmDialog_.setCancelLabel( |
260 localStrings.getString('oauthEnrollCancelAutoEnrollmentGoBack')); | 262 localStrings.getString('oauthEnrollCancelAutoEnrollmentGoBack')); |
261 this.confirmDialog_.setInitialFocusOnCancel(); | 263 this.confirmDialog_.setInitialFocusOnCancel(); |
262 } | 264 } |
263 this.confirmDialog_.show( | 265 this.confirmDialog_.show( |
264 localStrings.getString('oauthEnrollCancelAutoEnrollmentReally'), | 266 localStrings.getString('oauthEnrollCancelAutoEnrollmentReally'), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 var msg = m.data; | 303 var msg = m.data; |
302 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) | 304 if (msg.method == 'completeLogin' && this.isSigninMessage_(m)) |
303 chrome.send('oauthEnrollCompleteLogin', [msg.email, msg.password]); | 305 chrome.send('oauthEnrollCompleteLogin', [msg.email, msg.password]); |
304 } | 306 } |
305 }; | 307 }; |
306 | 308 |
307 return { | 309 return { |
308 OAuthEnrollmentScreen: OAuthEnrollmentScreen | 310 OAuthEnrollmentScreen: OAuthEnrollmentScreen |
309 }; | 311 }; |
310 }); | 312 }); |
OLD | NEW |