OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 27 matching lines...) Expand all Loading... |
38 options.accounts.UserNameEdit.decorate(userNameEdit); | 38 options.accounts.UserNameEdit.decorate(userNameEdit); |
39 userNameEdit.addEventListener('add', this.handleAddUser_); | 39 userNameEdit.addEventListener('add', this.handleAddUser_); |
40 | 40 |
41 // If the current user is not the owner, show some warning, | 41 // If the current user is not the owner, show some warning, |
42 // and do not show the user list. | 42 // and do not show the user list. |
43 if (AccountsOptions.currentUserIsOwner()) { | 43 if (AccountsOptions.currentUserIsOwner()) { |
44 if (!AccountsOptions.whitelistIsManaged()) { | 44 if (!AccountsOptions.whitelistIsManaged()) { |
45 options.accounts.UserList.decorate(userList); | 45 options.accounts.UserList.decorate(userList); |
46 } | 46 } |
47 } else { | 47 } else { |
48 $('ownerOnlyWarning').classList.remove('hidden'); | 48 $('ownerOnlyWarning').hidden = false; |
49 } | 49 } |
50 | 50 |
51 this.addEventListener('visibleChange', this.handleVisibleChange_); | 51 this.addEventListener('visibleChange', this.handleVisibleChange_); |
52 | 52 |
53 $('useWhitelistCheck').addEventListener('change', | 53 $('useWhitelistCheck').addEventListener('change', |
54 this.handleUseWhitelistCheckChange_.bind(this)); | 54 this.handleUseWhitelistCheckChange_.bind(this)); |
55 | 55 |
56 Preferences.getInstance().addEventListener( | 56 Preferences.getInstance().addEventListener( |
57 $('useWhitelistCheck').pref, | 57 $('useWhitelistCheck').pref, |
58 this.handleUseWhitelistPrefChange_.bind(this)); | 58 this.handleUseWhitelistPrefChange_.bind(this)); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 userList.addUser(users[i]); | 141 userList.addUser(users[i]); |
142 } | 142 } |
143 }; | 143 }; |
144 | 144 |
145 // Export | 145 // Export |
146 return { | 146 return { |
147 AccountsOptions: AccountsOptions | 147 AccountsOptions: AccountsOptions |
148 }; | 148 }; |
149 | 149 |
150 }); | 150 }); |
OLD | NEW |