Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1340)

Side by Side Diff: chrome/browser/resources/chromeos/login/screen_gaia_signin.js

Issue 426153003: Consumer management enrollment signin screen change: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /** 5 /**
6 * @fileoverview Oobe signin screen implementation. 6 * @fileoverview Oobe signin screen implementation.
7 */ 7 */
8 8
9 <include src="../../gaia_auth_host/gaia_auth_host.js"> 9 <include src="../../gaia_auth_host/gaia_auth_host.js">
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 */ 49 */
50 isLocal_: false, 50 isLocal_: false,
51 51
52 /** 52 /**
53 * Email of the user, which is logging in using offline mode. 53 * Email of the user, which is logging in using offline mode.
54 * @type {string} 54 * @type {string}
55 */ 55 */
56 email: '', 56 email: '',
57 57
58 /** 58 /**
59 * Whether consumer management enrollment is in progress.
60 * @type {boolean}
61 * @private
62 */
63 isEnrollingConsumerManagement_: false,
64
65 /**
59 * Timer id of pending load. 66 * Timer id of pending load.
60 * @type {number} 67 * @type {number}
61 * @private 68 * @private
62 */ 69 */
63 loadingTimer_: undefined, 70 loadingTimer_: undefined,
64 71
65 /** 72 /**
66 * Whether user can cancel Gaia screen. 73 * Whether user can cancel Gaia screen.
67 * @type {boolean} 74 * @type {boolean}
68 * @private 75 * @private
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 this.showLoadingUI_(loading); 211 this.showLoadingUI_(loading);
205 }, 212 },
206 213
207 /** 214 /**
208 * Event handler that is invoked just before the frame is shown. 215 * Event handler that is invoked just before the frame is shown.
209 * @param {string} data Screen init payload. Url of auth extension start 216 * @param {string} data Screen init payload. Url of auth extension start
210 * page. 217 * page.
211 */ 218 */
212 onBeforeShow: function(data) { 219 onBeforeShow: function(data) {
213 chrome.send('loginUIStateChanged', ['gaia-signin', true]); 220 chrome.send('loginUIStateChanged', ['gaia-signin', true]);
214 $('login-header-bar').signinUIState = SIGNIN_UI_STATE.GAIA_SIGNIN; 221 $('login-header-bar').signinUIState =
222 this.isEnrollingConsumerManagement_ ?
223 SIGNIN_UI_STATE.CONSUMER_MANAGEMENT_ENROLLMENT :
224 SIGNIN_UI_STATE.GAIA_SIGNIN;
215 225
216 // Ensure that GAIA signin (or loading UI) is actually visible. 226 // Ensure that GAIA signin (or loading UI) is actually visible.
217 window.webkitRequestAnimationFrame(function() { 227 window.webkitRequestAnimationFrame(function() {
218 chrome.send('loginVisible', ['gaia-loading']); 228 chrome.send('loginVisible', ['gaia-loading']);
219 }); 229 });
220 230
221 // Button header is always visible when sign in is presented. 231 // Button header is always visible when sign in is presented.
222 // Header is hidden once GAIA reports on successful sign in. 232 // Header is hidden once GAIA reports on successful sign in.
223 Oobe.getInstance().headerHidden = false; 233 Oobe.getInstance().headerHidden = false;
224 }, 234 },
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 $('createAccount').hidden = !data.createAccount; 310 $('createAccount').hidden = !data.createAccount;
301 $('guestSignin').hidden = !data.guestSignin; 311 $('guestSignin').hidden = !data.guestSignin;
302 $('createManagedUserPane').hidden = !data.managedUsersEnabled; 312 $('createManagedUserPane').hidden = !data.managedUsersEnabled;
303 313
304 $('createManagedUserLinkPlaceholder').hidden = 314 $('createManagedUserLinkPlaceholder').hidden =
305 !data.managedUsersCanCreate; 315 !data.managedUsersCanCreate;
306 $('createManagedUserNoManagerText').hidden = data.managedUsersCanCreate; 316 $('createManagedUserNoManagerText').hidden = data.managedUsersCanCreate;
307 $('createManagedUserNoManagerText').textContent = 317 $('createManagedUserNoManagerText').textContent =
308 data.managedUsersRestrictionReason; 318 data.managedUsersRestrictionReason;
309 319
320 $('consumerManagementEnrollment').hidden =
321 !data.isEnrollingConsumerManagement;
322
310 this.isShowUsers_ = data.isShowUsers; 323 this.isShowUsers_ = data.isShowUsers;
311 this.updateCancelButtonState(); 324 this.updateCancelButtonState();
312 325
326 this.isEnrollingConsumerManagement_ = data.isEnrollingConsumerManagement;
327
313 // Sign-in right panel is hidden if all of its items are hidden. 328 // Sign-in right panel is hidden if all of its items are hidden.
314 var noRightPanel = $('gaia-signin-reason').hidden && 329 var noRightPanel = $('gaia-signin-reason').hidden &&
315 $('createAccount').hidden && 330 $('createAccount').hidden &&
316 $('guestSignin').hidden && 331 $('guestSignin').hidden &&
317 $('createManagedUserPane').hidden; 332 $('createManagedUserPane').hidden &&
333 $('consumerManagementEnrollment').hidden;
318 this.classList.toggle('no-right-panel', noRightPanel); 334 this.classList.toggle('no-right-panel', noRightPanel);
319 if (Oobe.getInstance().currentScreen === this) 335 if (Oobe.getInstance().currentScreen === this)
320 Oobe.getInstance().updateScreenSize(this); 336 Oobe.getInstance().updateScreenSize(this);
321 }, 337 },
322 338
323 /** 339 /**
324 * Sends the authenticated user's e-mail address to the auth extension. 340 * Sends the authenticated user's e-mail address to the auth extension.
325 * @param {number} attemptToken The opaque token provided to 341 * @param {number} attemptToken The opaque token provided to
326 * onRetrieveAuthenticatedUserEmail_. 342 * onRetrieveAuthenticatedUserEmail_.
327 * @param {string} email The authenticated user's e-mail address. 343 * @param {string} email The authenticated user's e-mail address.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 '<a id="createAccountLink" class="signin-link" href="#">', 570 '<a id="createAccountLink" class="signin-link" href="#">',
555 '</a>'); 571 '</a>');
556 $('guestSignin').innerHTML = loadTimeData.getStringF( 572 $('guestSignin').innerHTML = loadTimeData.getStringF(
557 'guestSignin', 573 'guestSignin',
558 '<a id="guestSigninLink" class="signin-link" href="#">', 574 '<a id="guestSigninLink" class="signin-link" href="#">',
559 '</a>'); 575 '</a>');
560 $('createManagedUserLinkPlaceholder').innerHTML = loadTimeData.getStringF( 576 $('createManagedUserLinkPlaceholder').innerHTML = loadTimeData.getStringF(
561 'createLocallyManagedUser', 577 'createLocallyManagedUser',
562 '<a id="createManagedUserLink" class="signin-link" href="#">', 578 '<a id="createManagedUserLink" class="signin-link" href="#">',
563 '</a>'); 579 '</a>');
580 $('consumerManagementEnrollment').innerHTML = loadTimeData.getString(
581 'consumerManagementEnrollmentSigninMessage');
564 $('createAccountLink').addEventListener('click', function(e) { 582 $('createAccountLink').addEventListener('click', function(e) {
565 chrome.send('createAccount'); 583 chrome.send('createAccount');
566 e.preventDefault(); 584 e.preventDefault();
567 }); 585 });
568 $('guestSigninLink').addEventListener('click', function(e) { 586 $('guestSigninLink').addEventListener('click', function(e) {
569 chrome.send('launchIncognito'); 587 chrome.send('launchIncognito');
570 e.preventDefault(); 588 e.preventDefault();
571 }); 589 });
572 $('createManagedUserLink').addEventListener('click', function(e) { 590 $('createManagedUserLink').addEventListener('click', function(e) {
573 chrome.send('showLocallyManagedUserCreationScreen'); 591 chrome.send('showLocallyManagedUserCreationScreen');
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 * For more info see C++ class 'WebUILoginView' which calls this method. 646 * For more info see C++ class 'WebUILoginView' which calls this method.
629 * @param {number} error Error code. 647 * @param {number} error Error code.
630 * @param {string} url The URL that failed to load. 648 * @param {string} url The URL that failed to load.
631 */ 649 */
632 onFrameError: function(error, url) { 650 onFrameError: function(error, url) {
633 this.error_ = error; 651 this.error_ = error;
634 chrome.send('frameLoadingCompleted', [this.error_]); 652 chrome.send('frameLoadingCompleted', [this.error_]);
635 }, 653 },
636 }; 654 };
637 }); 655 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698