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

Side by Side Diff: chrome/browser/resources/md_user_manager/user_manager.js

Issue 2025433002: MD User Manager: Display error message when all profiles are locked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 4 years, 6 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 <include src="../../../../ui/login/screen.js"> 5 <include src="../../../../ui/login/screen.js">
6 <include src="../../../../ui/login/bubble.js"> 6 <include src="../../../../ui/login/bubble.js">
7 <include src="../../../../ui/login/login_ui_tools.js"> 7 <include src="../../../../ui/login/login_ui_tools.js">
8 <include src="../../../../ui/login/display_manager.js"> 8 <include src="../../../../ui/login/display_manager.js">
9 <include src="../../../../ui/login/account_picker/user_pod_template.js"> 9 <include src="../../../../ui/login/account_picker/user_pod_template.js">
10 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> 10 <include src="../../../../ui/login/account_picker/screen_account_picker.js">
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 /** 59 /**
60 * Initializes the UserManager. 60 * Initializes the UserManager.
61 */ 61 */
62 UserManager.initialize = function() { 62 UserManager.initialize = function() {
63 cr.ui.login.DisplayManager.initialize(); 63 cr.ui.login.DisplayManager.initialize();
64 login.AccountPickerScreen.register(); 64 login.AccountPickerScreen.register();
65 cr.ui.Bubble.decorate($('bubble')); 65 cr.ui.Bubble.decorate($('bubble'));
66 66
67 signin.ProfileBrowserProxyImpl.getInstance().initializeUserManager( 67 signin.ProfileBrowserProxyImpl.getInstance().initializeUserManager(
68 window.location.hash); 68 window.location.hash);
69 cr.addWebUIListener('show-error-dialog', cr.ui.UserManager.showErrorDialog);
69 }; 70 };
70 71
71 /** 72 /**
72 * Shows the given screen. 73 * Shows the given screen.
73 * @param {boolean} showGuest True if 'Browse as Guest' button should be 74 * @param {boolean} showGuest True if 'Browse as Guest' button should be
74 * displayed. 75 * displayed.
75 * @param {boolean} showAddPerson True if 'Add Person' button should be 76 * @param {boolean} showAddPerson True if 'Add Person' button should be
76 * displayed. 77 * displayed.
77 */ 78 */
78 UserManager.showUserManagerScreen = function(showGuest, showAddPerson) { 79 UserManager.showUserManagerScreen = function(showGuest, showAddPerson) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 DisplayManager.showSignInError(loginAttempts, message, link, helpId); 126 DisplayManager.showSignInError(loginAttempts, message, link, helpId);
126 }; 127 };
127 128
128 /** 129 /**
129 * Clears error bubble as well as optional menus that could be open. 130 * Clears error bubble as well as optional menus that could be open.
130 */ 131 */
131 UserManager.clearErrors = function() { 132 UserManager.clearErrors = function() {
132 DisplayManager.clearErrors(); 133 DisplayManager.clearErrors();
133 }; 134 };
134 135
136 /**
137 * Shows the error dialog populated with the given message.
138 * @param {string} message Error message to show.
139 */
140 UserManager.showErrorDialog = function(message) {
141 document.querySelector('error-dialog').show(message);
142 };
143
135 // Export 144 // Export
136 return { 145 return {
137 UserManager: UserManager 146 UserManager: UserManager
138 }; 147 };
139 }); 148 });
140 149
141 // Alias to Oobe for use in src/ui/login/account_picker/user_pod_row.js 150 // Alias to Oobe for use in src/ui/login/account_picker/user_pod_row.js
142 var Oobe = cr.ui.UserManager; 151 var Oobe = cr.ui.UserManager;
143 152
144 // Allow selection events on components with editable text (password field) 153 // Allow selection events on components with editable text (password field)
145 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) 154 // bug (http://code.google.com/p/chromium/issues/detail?id=125863)
146 disableTextSelectAndDrag(function(e) { 155 disableTextSelectAndDrag(function(e) {
147 var src = e.target; 156 var src = e.target;
148 return src instanceof HTMLTextAreaElement || 157 return src instanceof HTMLTextAreaElement ||
149 src instanceof HTMLInputElement && 158 src instanceof HTMLInputElement &&
150 /text|password|search/.test(src.type); 159 /text|password|search/.test(src.type);
151 }); 160 });
152 161
153 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize); 162 document.addEventListener('DOMContentLoaded', cr.ui.UserManager.initialize);
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_user_manager/user_manager.html ('k') | chrome/browser/ui/webui/signin/md_user_manager_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698