| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <include src="../../../../ui/login/screen.js"> | 4 <include src="../../../../ui/login/screen.js"> |
| 5 <include src="../../../../ui/login/bubble.js"> | 5 <include src="../../../../ui/login/bubble.js"> |
| 6 <include src="../../../../ui/login/login_ui_tools.js"> | 6 <include src="../../../../ui/login/login_ui_tools.js"> |
| 7 <include src="../../../../ui/login/display_manager.js"> | 7 <include src="../../../../ui/login/display_manager.js"> |
| 8 <include src="control_bar.js"> | 8 <include src="control_bar.js"> |
| 9 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> | 9 <include src="../../../../ui/login/account_picker/screen_account_picker.js"> |
| 10 <include src="../../../../ui/login/account_picker/user_pod_row.js"> | 10 <include src="../../../../ui/login/account_picker/user_pod_row.js"> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 cr.addSingletonGetter(Oobe); | 27 cr.addSingletonGetter(Oobe); |
| 28 | 28 |
| 29 Oobe.prototype = { | 29 Oobe.prototype = { |
| 30 __proto__: DisplayManager.prototype, | 30 __proto__: DisplayManager.prototype, |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * Shows the given screen. | 34 * Shows the given screen. |
| 35 * @param {Object} screen Screen params dict, e.g. {id: screenId, data: data} | 35 * @param {bool} showGuest Whether the 'Browse as Guest' button is displayed. |
| 36 * @param {bool} showAddPerson Whether the 'Add Person' button is displayed. |
| 36 */ | 37 */ |
| 37 Oobe.showUserManagerScreen = function(showGuest) { | 38 Oobe.showUserManagerScreen = function(showGuest, showAddPerson) { |
| 38 Oobe.getInstance().showScreen({id: 'account-picker', | 39 Oobe.getInstance().showScreen({id: 'account-picker', |
| 39 data: {disableAddUser: false}}); | 40 data: {disableAddUser: false}}); |
| 40 // The ChromeOS account-picker will hide the AddUser button if a user is | 41 // The ChromeOS account-picker will hide the AddUser button if a user is |
| 41 // logged in and the screen is "locked", so we must re-enabled it | 42 // logged in and the screen is "locked", so we must re-enabled it |
| 42 $('add-user-header-bar-item').hidden = false; | 43 $('add-user-header-bar-item').hidden = false; |
| 43 | 44 |
| 44 // Hide the Guest Mode option if the user is not permitted to select it. | 45 // Hide control options if the user does not have the right permissions. |
| 45 $('guest-user-button').hidden = !showGuest; | 46 $('guest-user-button').hidden = !showGuest; |
| 47 $('add-user-button').hidden = !showAddPerson; |
| 46 $('login-header-bar').hidden = false; | 48 $('login-header-bar').hidden = false; |
| 47 | 49 |
| 48 // Disable the context menu, as the Print/Inspect element items don't | 50 // Disable the context menu, as the Print/Inspect element items don't |
| 49 // make sense when displayed as a widget. | 51 // make sense when displayed as a widget. |
| 50 document.addEventListener('contextmenu', function(e) {e.preventDefault();}); | 52 document.addEventListener('contextmenu', function(e) {e.preventDefault();}); |
| 51 | 53 |
| 52 var hash = window.location.hash; | 54 var hash = window.location.hash; |
| 53 if (hash && hash == '#tutorial') | 55 if (hash && hash == '#tutorial') |
| 54 UserManagerTutorial.startTutorial(); | 56 UserManagerTutorial.startTutorial(); |
| 55 }; | 57 }; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // Allow selection events on components with editable text (password field) | 154 // Allow selection events on components with editable text (password field) |
| 153 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 155 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
| 154 disableTextSelectAndDrag(function(e) { | 156 disableTextSelectAndDrag(function(e) { |
| 155 var src = e.target; | 157 var src = e.target; |
| 156 return src instanceof HTMLTextAreaElement || | 158 return src instanceof HTMLTextAreaElement || |
| 157 src instanceof HTMLInputElement && | 159 src instanceof HTMLInputElement && |
| 158 /text|password|search/.test(src.type); | 160 /text|password|search/.test(src.type); |
| 159 }); | 161 }); |
| 160 | 162 |
| 161 document.addEventListener('DOMContentLoaded', UserManager.initialize); | 163 document.addEventListener('DOMContentLoaded', UserManager.initialize); |
| OLD | NEW |