Chromium Code Reviews| Index: chrome/browser/resources/md_user_manager/user_manager.js |
| diff --git a/chrome/browser/resources/user_manager/user_manager.js b/chrome/browser/resources/md_user_manager/user_manager.js |
| similarity index 62% |
| copy from chrome/browser/resources/user_manager/user_manager.js |
| copy to chrome/browser/resources/md_user_manager/user_manager.js |
| index 39d76d4764abe302a71089b17d7563c0322f5290..8643730e98727d13be264693fdc2eb6b619331f7 100644 |
| --- a/chrome/browser/resources/user_manager/user_manager.js |
| +++ b/chrome/browser/resources/md_user_manager/user_manager.js |
| @@ -1,28 +1,27 @@ |
| -// Copyright 2013 The Chromium Authors. All rights reserved. |
| -// Use of this source code is governed by a BSD-style license that can be |
| -// found in the LICENSE file. |
| +/* Copyright 2016 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| <include src="../../../../ui/login/screen.js"> |
| <include src="../../../../ui/login/bubble.js"> |
| <include src="../../../../ui/login/login_ui_tools.js"> |
| <include src="../../../../ui/login/display_manager.js"> |
| -<include src="control_bar.js"> |
| <include src="../../../../ui/login/account_picker/screen_account_picker.js"> |
| <include src="../../../../ui/login/account_picker/user_pod_row.js"> |
| <include src="../../../../ui/login/resource_loader.js"> |
| -<include src="user_manager_tutorial.js"> |
| + |
| cr.define('cr.ui', function() { |
| var DisplayManager = cr.ui.login.DisplayManager; |
| - var UserManagerTutorial = cr.ui.login.UserManagerTutorial; |
| /** |
| - * Constructs an Out of box controller. It manages initialization of screens, |
| - * transitions, error messages display. |
| - * @extends {DisplayManager} |
| - * @constructor |
| + * Constructs an Out of box controller. It manages initialization of screens, |
| + * transitions, error messages display. |
| + * @constructor |
| + * @extends {DisplayManager} |
| */ |
| - function Oobe() { |
| - } |
| + function Oobe() {} |
| cr.addSingletonGetter(Oobe); |
| @@ -32,20 +31,15 @@ cr.define('cr.ui', function() { |
| /** |
| * Shows the given screen. |
| - * @param {bool} showGuest Whether the 'Browse as Guest' button is displayed. |
| - * @param {bool} showAddPerson Whether the 'Add Person' button is displayed. |
| + * @param {boolean} showGuest whether |Browse as Guest| button is displayed. |
|
tommycli
2016/02/08 18:45:19
"True if the... should be displayed."
Moe
2016/02/09 00:15:33
Done.
|
| + * @param {boolean} showAddPerson wether |Add Person| button is displayed. |
|
tommycli
2016/02/08 18:45:19
misspelled
Moe
2016/02/09 00:15:34
Done.
|
| */ |
| Oobe.showUserManagerScreen = function(showGuest, showAddPerson) { |
| Oobe.getInstance().showScreen({id: 'account-picker', |
| data: {disableAddUser: false}}); |
| - // The ChromeOS account-picker will hide the AddUser button if a user is |
| - // logged in and the screen is "locked", so we must re-enabled it |
| - $('add-user-header-bar-item').hidden = false; |
| - |
| // Hide control options if the user does not have the right permissions. |
| - $('guest-user-button').hidden = !showGuest; |
| - $('add-user-button').hidden = !showAddPerson; |
| - $('login-header-bar').hidden = false; |
| + document.querySelector('control-bar').showGuest = showGuest; |
| + document.querySelector('control-bar').showAddPerson = showAddPerson; |
| // Disable the context menu, as the Print/Inspect element items don't |
| // make sense when displayed as a widget. |
| @@ -53,12 +47,12 @@ cr.define('cr.ui', function() { |
| var hash = window.location.hash; |
| if (hash && hash == '#tutorial') |
| - UserManagerTutorial.startTutorial(); |
| + document.querySelector('user-manager-tutorial').startTutorial(); |
| }; |
| /** |
| * Open a new browser for the given profile. |
| - * @param {string} profilePath The profile's path. |
| + * @param {!string} profilePath The profile's path. |
|
tommycli
2016/02/08 18:45:19
I believe string is implicitly non-nullable.
Moe
2016/02/09 00:15:34
Done.
|
| */ |
| Oobe.launchUser = function(profilePath) { |
| chrome.send('launchUser', [profilePath]); |
| @@ -73,18 +67,18 @@ cr.define('cr.ui', function() { |
| /** |
| * Shows signin UI. |
| - * @param {string} opt_email An optional email for signin UI. |
| + * @param {!string} optEmail An optional email for signin UI. |
|
tommycli
2016/02/08 18:45:19
Is it blank if no email? or null?
Moe
2016/02/09 00:15:33
seems like either blank or an email. updated it ac
|
| */ |
| - Oobe.showSigninUI = function(opt_email) { |
| - DisplayManager.showSigninUI(opt_email); |
| + Oobe.showSigninUI = function(optEmail) { |
| + DisplayManager.showSigninUI(optEmail); |
| }; |
| /** |
| * Shows sign-in error bubble. |
| - * @param {number} loginAttempts Number of login attemps tried. |
| - * @param {string} message Error message to show. |
| - * @param {string} link Text to use for help link. |
| - * @param {number} helpId Help topic Id associated with help link. |
| + * @param {!number} loginAttempts Number of login attemps tried. |
| + * @param {!string} message Error message to show. |
| + * @param {!string} link Text to use for help link. |
| + * @param {!number} helpId Help topic Id associated with help link. |
| */ |
| Oobe.showSignInError = function(loginAttempts, message, link, helpId) { |
| DisplayManager.showSignInError(loginAttempts, message, link, helpId); |
| @@ -113,11 +107,9 @@ cr.define('cr.ui', function() { |
| /** |
| * Show the user manager tutorial |
| - * @param {string} email The user's email, if signed in. |
| - * @param {string} displayName The user's display name. |
| */ |
| Oobe.showUserManagerTutorial = function() { |
| - UserManagerTutorial.startTutorial(); |
| + document.querySelector('user-manager-tutorial').startTutorial(); |
| }; |
| // Export |
| @@ -131,14 +123,8 @@ cr.define('UserManager', function() { |
| function initialize() { |
| cr.ui.login.DisplayManager.initialize(); |
| - cr.ui.login.UserManagerTutorial.initialize(); |
| login.AccountPickerScreen.register(); |
| cr.ui.Bubble.decorate($('bubble')); |
| - login.HeaderBar.decorate($('login-header-bar')); |
| - |
| - // Hide the header bar until the showUserManagerMethod can apply function |
| - // parameters that affect widget visiblity. |
| - $('login-header-bar').hidden = true; |
| chrome.send('userManagerInitialize', [window.location.hash]); |
| } |