OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 // Set up accounts page. | 34 // Set up accounts page. |
35 var userList = $('userList'); | 35 var userList = $('userList'); |
36 options.accounts.UserList.decorate(userList); | 36 options.accounts.UserList.decorate(userList); |
37 | 37 |
38 var userNameEdit = $('userNameEdit'); | 38 var userNameEdit = $('userNameEdit'); |
39 options.accounts.UserNameEdit.decorate(userNameEdit); | 39 options.accounts.UserNameEdit.decorate(userNameEdit); |
40 userNameEdit.addEventListener('add', this.handleAddUser_); | 40 userNameEdit.addEventListener('add', this.handleAddUser_); |
41 | 41 |
42 userList.disabled = | 42 userList.disabled = |
43 userNameEdit.disabled = !AccountsOptions.currentUserIsOwner(); | 43 userNameEdit.disabled = !AccountsOptions.currentUserIsOwner(); |
| 44 // If the current user is not the owner, show some warning. |
| 45 if (!AccountsOptions.currentUserIsOwner()) { |
| 46 $('ownerOnlyWarning').classList.remove('hidden'); |
| 47 } |
44 | 48 |
45 this.addEventListener('visibleChange', this.handleVisibleChange_); | 49 this.addEventListener('visibleChange', this.handleVisibleChange_); |
46 | 50 |
47 $('useWhitelistCheck').addEventListener('click', | 51 $('useWhitelistCheck').addEventListener('click', |
48 this.handleUseWhitelistCheckClick_); | 52 this.handleUseWhitelistCheckClick_); |
49 }, | 53 }, |
50 | 54 |
51 /** | 55 /** |
52 * Handler for OptionsPage's visible property change event. | 56 * Handler for OptionsPage's visible property change event. |
53 * @private | 57 * @private |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 userList.addUser(users[i]); | 109 userList.addUser(users[i]); |
106 } | 110 } |
107 }; | 111 }; |
108 | 112 |
109 // Export | 113 // Export |
110 return { | 114 return { |
111 AccountsOptions: AccountsOptions | 115 AccountsOptions: AccountsOptions |
112 }; | 116 }; |
113 | 117 |
114 }); | 118 }); |
OLD | NEW |