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

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

Issue 1889213002: Revert of Add enterprise enrollment support for fake users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 8 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 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 Common OOBE controller methods. This method is shared between 6 * @fileoverview Common OOBE controller methods. This method is shared between
7 * OOBE, login, and the lock screen. Add only methods that need to be shared 7 * OOBE, login, and the lock screen. Add only methods that need to be shared
8 * between all *three* screens here, as each additional method increases the 8 * between all *three* screens here, as each additional method increases the
9 * time it takes to show the lock screen. 9 * time it takes to show the lock screen.
10 * 10 *
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 */ 279 */
280 Oobe.skipToLoginForTesting = function() { 280 Oobe.skipToLoginForTesting = function() {
281 Oobe.disableSigninUI(); 281 Oobe.disableSigninUI();
282 chrome.send('skipToLoginForTesting'); 282 chrome.send('skipToLoginForTesting');
283 }; 283 };
284 284
285 /** 285 /**
286 * Login for telemetry. 286 * Login for telemetry.
287 * @param {string} username Login username. 287 * @param {string} username Login username.
288 * @param {string} password Login password. 288 * @param {string} password Login password.
289 * @param {boolean} enterpriseEnroll Login as an enterprise enrollment?
290 */ 289 */
291 Oobe.loginForTesting = function(username, password, gaia_id, 290 Oobe.loginForTesting = function(username, password, gaia_id) {
292 enterpriseEnroll = false) {
293 // Helper method that runs |fn| after |screenName| is visible.
294 function waitForOobeScreen(screenName, fn) {
295 if (Oobe.getInstance().currentScreen.id === screenName) {
296 fn();
297 } else {
298 $('oobe').addEventListener('screenchanged', function handler(e) {
299 if (e.detail == screenName) {
300 $('oobe').removeEventListener('screenchanged', handler);
301 fn();
302 }
303 });
304 }
305 }
306
307 Oobe.disableSigninUI(); 291 Oobe.disableSigninUI();
308 chrome.send('skipToLoginForTesting', [username]); 292 chrome.send('skipToLoginForTesting', [username]);
309 293 chrome.send('completeLogin', [gaia_id, username, password, false]);
310 if (!enterpriseEnroll) {
311 chrome.send('completeLogin', [gaia_id, username, password, false]);
312 } else {
313 waitForOobeScreen('gaia-signin', function() {
314 chrome.send('toggleEnrollmentScreen');
315 chrome.send('toggleFakeEnrollment');
316 });
317
318 waitForOobeScreen('oauth-enrollment', function() {
319 chrome.send('oauthEnrollCompleteLogin', [username, 'authcode']);
320 chrome.send('completeLogin', [gaia_id, username, password, false]);
321 });
322 }
323 }; 294 };
324 295
325 /** 296 /**
326 * Guest login for telemetry. 297 * Guest login for telemetry.
327 */ 298 */
328 Oobe.guestLoginForTesting = function() { 299 Oobe.guestLoginForTesting = function() {
329 Oobe.skipToLoginForTesting(); 300 Oobe.skipToLoginForTesting();
330 chrome.send('launchIncognito'); 301 chrome.send('launchIncognito');
331 }; 302 };
332 303
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 394
424 395
425 (function() { 396 (function() {
426 'use strict'; 397 'use strict';
427 398
428 document.addEventListener('DOMContentLoaded', function() { 399 document.addEventListener('DOMContentLoaded', function() {
429 Oobe.initialize(); 400 Oobe.initialize();
430 }); 401 });
431 })(); 402 })();
432 403
OLDNEW
« no previous file with comments | « chrome/browser/policy/test/policy_testserver.py ('k') | chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698