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

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

Issue 2507873003: Allow adding user and launching guest mode when all profiles are lock while force sign in is enable… (Closed)
Patch Set: Created 4 years, 1 month 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 'control-bar' is the horizontal bar at the bottom of the user 6 * @fileoverview 'control-bar' is the horizontal bar at the bottom of the user
7 * manager screen. 7 * manager screen.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'control-bar', 10 is: 'control-bar',
(...skipping 15 matching lines...) Expand all
26 /** 26 /**
27 * True if 'Add Person' button is displayed. 27 * True if 'Add Person' button is displayed.
28 * @type {boolean} 28 * @type {boolean}
29 */ 29 */
30 showAddPerson: { 30 showAddPerson: {
31 type: Boolean, 31 type: Boolean,
32 value: false 32 value: false
33 }, 33 },
34 34
35 /** @private {!signin.ProfileBrowserProxy} */ 35 /** @private {!signin.ProfileBrowserProxy} */
36 browserProxy_: Object 36 browserProxy_: Object,
37
38 /**
39 * True if the force sign in policy is enabled.
40 * @type {boolean}
41 * @private
tommycli 2016/11/17 23:06:23 nit: can be @private {boolean}
zmin 2016/11/17 23:30:04 Done.
42 */
43 isForceSigninEnabled_: {
44 type: Boolean,
45 value: function() {
46 return loadTimeData.getBoolean('isForceSigninEnabled');
47 },
48 }
49
tommycli 2016/11/17 23:06:23 nit: extra line
zmin 2016/11/17 23:30:04 Done.
37 }, 50 },
38 51
39 /** @override */ 52 /** @override */
40 created: function() { 53 created: function() {
41 this.browserProxy_ = signin.ProfileBrowserProxyImpl.getInstance(); 54 this.browserProxy_ = signin.ProfileBrowserProxyImpl.getInstance();
42 }, 55 },
43 56
44 /** 57 /**
45 * Handler for 'Browse as Guest' button click event. 58 * Handler for 'Browse as Guest' button click event.
46 * @param {!Event} event 59 * @param {!Event} event
47 * @private 60 * @private
48 */ 61 */
49 onLaunchGuestTap_: function(event) { 62 onLaunchGuestTap_: function(event) {
50 this.browserProxy_.areAllProfilesLocked().then( 63 this.browserProxy_.areAllProfilesLocked().then(
51 function(allProfilesLocked) { 64 function(allProfilesLocked) {
52 if (!allProfilesLocked) { 65 if (!allProfilesLocked || this.isForceSigninEnabled_) {
53 this.browserProxy_.launchGuestUser(); 66 this.browserProxy_.launchGuestUser();
54 } else { 67 } else {
55 document.querySelector('error-dialog').show( 68 document.querySelector('error-dialog').show(
56 this.i18n('browseAsGuestAllProfilesLockedError')); 69 this.i18n('browseAsGuestAllProfilesLockedError'));
57 } 70 }
58 }.bind(this)); 71 }.bind(this));
59 }, 72 },
60 73
61 /** 74 /**
62 * Handler for 'Add Person' button click event. 75 * Handler for 'Add Person' button click event.
63 * @param {!Event} event 76 * @param {!Event} event
64 * @private 77 * @private
65 */ 78 */
66 onAddUserTap_: function(event) { 79 onAddUserTap_: function(event) {
67 this.browserProxy_.areAllProfilesLocked().then( 80 this.browserProxy_.areAllProfilesLocked().then(
68 function(allProfilesLocked) { 81 function(allProfilesLocked) {
69 if (!allProfilesLocked) { 82 if (!allProfilesLocked || this.isForceSigninEnabled_) {
70 // Event is caught by user-manager-pages. 83 // Event is caught by user-manager-pages.
71 this.fire('change-page', {page: 'create-user-page'}); 84 this.fire('change-page', {page: 'create-user-page'});
72 } else { 85 } else {
73 document.querySelector('error-dialog').show( 86 document.querySelector('error-dialog').show(
74 this.i18n('addProfileAllProfilesLockedError')); 87 this.i18n('addProfileAllProfilesLockedError'));
75 } 88 }
76 }.bind(this)); 89 }.bind(this));
77 } 90 }
78 }); 91 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698