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

Side by Side Diff: chrome/browser/resources/settings/people_page/users_page.js

Issue 2842303004: MD Settings: update dialogs to focus without ink when using mouse (Closed)
Patch Set: merge Created 3 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 6 * @fileoverview
7 * 'settings-users-page' is the settings page for managing user accounts on 7 * 'settings-users-page' is the settings page for managing user accounts on
8 * the device. 8 * the device.
9 */ 9 */
10 Polymer({ 10 Polymer({
11 is: 'settings-users-page', 11 is: 'settings-users-page',
12 12
13 properties: { 13 properties: {
14 /** 14 /**
15 * Preferences state. 15 * Preferences state.
16 */ 16 */
17 prefs: { 17 prefs: {
18 type: Object, 18 type: Object,
19 notify: true, 19 notify: true,
20 }, 20 },
21 21
22 /** @private */ 22 /** @private */
23 isOwner_: { 23 isOwner_: {
24 type: Boolean, 24 type: Boolean,
25 value: true 25 value: true,
26 }, 26 },
27 27
28 /** @private */ 28 /** @private */
29 isWhitelistManaged_: { 29 isWhitelistManaged_: {
30 type: Boolean, 30 type: Boolean,
31 value: false 31 value: false,
32 }, 32 },
33 }, 33 },
34 34
35 /** @override */ 35 /** @override */
36 created: function() { 36 created: function() {
37 chrome.usersPrivate.isCurrentUserOwner(function(isOwner) { 37 chrome.usersPrivate.isCurrentUserOwner(function(isOwner) {
38 this.isOwner_ = isOwner; 38 this.isOwner_ = isOwner;
39 }.bind(this)); 39 }.bind(this));
40 40
41 chrome.usersPrivate.isWhitelistManaged(function(isWhitelistManaged) { 41 chrome.usersPrivate.isWhitelistManaged(function(isWhitelistManaged) {
42 this.isWhitelistManaged_ = isWhitelistManaged; 42 this.isWhitelistManaged_ = isWhitelistManaged;
43 }.bind(this)); 43 }.bind(this));
44 }, 44 },
45 45
46 /** 46 /**
47 * @param {!Event} e 47 * @param {!Event} e
48 * @private 48 * @private
49 */ 49 */
50 openAddUserDialog_: function(e) { 50 openAddUserDialog_: function(e) {
51 e.preventDefault(); 51 e.preventDefault();
52 this.$.addUserDialog.open(); 52 this.$.addUserDialog.open();
53 }, 53 },
54 54
55 /** @private */ 55 /** @private */
56 onAddUserDialogClose_: function() { 56 onAddUserDialogClose_: function() {
57 this.$$('#add-user-button a').focus(); 57 cr.ui.focusWithoutInk(assert(this.$$('#add-user-button a')));
58 }, 58 },
59 59
60 /** 60 /**
61 * @param {boolean} isOwner 61 * @param {boolean} isOwner
62 * @param {boolean} isWhitelistManaged 62 * @param {boolean} isWhitelistManaged
63 * @private 63 * @private
64 * @return {boolean} 64 * @return {boolean}
65 */ 65 */
66 isEditingDisabled_: function(isOwner, isWhitelistManaged) { 66 isEditingDisabled_: function(isOwner, isWhitelistManaged) {
67 return !isOwner || isWhitelistManaged; 67 return !isOwner || isWhitelistManaged;
68 }, 68 },
69 69
70 /** 70 /**
71 * @param {boolean} isOwner 71 * @param {boolean} isOwner
72 * @param {boolean} isWhitelistManaged 72 * @param {boolean} isWhitelistManaged
73 * @param {boolean} allowGuest 73 * @param {boolean} allowGuest
74 * @private 74 * @private
75 * @return {boolean} 75 * @return {boolean}
76 */ 76 */
77 isEditingUsersDisabled_: function(isOwner, isWhitelistManaged, allowGuest) { 77 isEditingUsersDisabled_: function(isOwner, isWhitelistManaged, allowGuest) {
78 return !isOwner || isWhitelistManaged || allowGuest; 78 return !isOwner || isWhitelistManaged || allowGuest;
79 } 79 }
80 }); 80 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698