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

Side by Side Diff: chrome/browser/resources/options/chromeos_accounts_options.js

Issue 6368029: Show user list only to owner (settings->users). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 cr.define('options', function() { 5 cr.define('options', function() {
6 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 8
9 ///////////////////////////////////////////////////////////////////////////// 9 /////////////////////////////////////////////////////////////////////////////
10 // AccountsOptions class: 10 // AccountsOptions class:
(...skipping 15 matching lines...) Expand all
26 26
27 /** 27 /**
28 * Initializes AccountsOptions page. 28 * Initializes AccountsOptions page.
29 */ 29 */
30 initializePage: function() { 30 initializePage: function() {
31 // Call base class implementation to starts preference initialization. 31 // Call base class implementation to starts preference initialization.
32 OptionsPage.prototype.initializePage.call(this); 32 OptionsPage.prototype.initializePage.call(this);
33 33
34 // Set up accounts page. 34 // Set up accounts page.
35 var userList = $('userList'); 35 var userList = $('userList');
36 options.accounts.UserList.decorate(userList);
37 36
38 var userNameEdit = $('userNameEdit'); 37 var userNameEdit = $('userNameEdit');
39 options.accounts.UserNameEdit.decorate(userNameEdit); 38 options.accounts.UserNameEdit.decorate(userNameEdit);
40 userNameEdit.addEventListener('add', this.handleAddUser_); 39 userNameEdit.addEventListener('add', this.handleAddUser_);
41 40
42 userList.disabled = 41 userList.disabled =
43 userNameEdit.disabled = !AccountsOptions.currentUserIsOwner(); 42 userNameEdit.disabled = !AccountsOptions.currentUserIsOwner();
44 // If the current user is not the owner, show some warning. 43 // If the current user is not the owner, show some warning,
45 if (!AccountsOptions.currentUserIsOwner()) { 44 // and do not show the user list.
45 if (AccountsOptions.currentUserIsOwner()) {
46 options.accounts.UserList.decorate(userList);
47 } else {
46 $('ownerOnlyWarning').classList.remove('hidden'); 48 $('ownerOnlyWarning').classList.remove('hidden');
47 } 49 }
48 50
49 this.addEventListener('visibleChange', this.handleVisibleChange_); 51 this.addEventListener('visibleChange', this.handleVisibleChange_);
50 52
51 $('useWhitelistCheck').addEventListener('click', 53 $('useWhitelistCheck').addEventListener('click',
52 this.handleUseWhitelistCheckClick_); 54 this.handleUseWhitelistCheckClick_);
53 }, 55 },
54 56
55 /** 57 /**
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 userList.addUser(users[i]); 111 userList.addUser(users[i]);
110 } 112 }
111 }; 113 };
112 114
113 // Export 115 // Export
114 return { 116 return {
115 AccountsOptions: AccountsOptions 117 AccountsOptions: AccountsOptions
116 }; 118 };
117 119
118 }); 120 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698