OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 ///////////////////////////////////////////////////////////////////////////// | 8 ///////////////////////////////////////////////////////////////////////////// |
9 // AccountsOptions class: | 9 // AccountsOptions class: |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... | |
34 OptionsPage.prototype.initializePage.call(this); | 34 OptionsPage.prototype.initializePage.call(this); |
35 | 35 |
36 // Set up accounts page. | 36 // Set up accounts page. |
37 var userList = $('userList'); | 37 var userList = $('userList'); |
38 userList.addEventListener('remove', this.handleRemoveUser_); | 38 userList.addEventListener('remove', this.handleRemoveUser_); |
39 | 39 |
40 var userNameEdit = $('userNameEdit'); | 40 var userNameEdit = $('userNameEdit'); |
41 options.accounts.UserNameEdit.decorate(userNameEdit); | 41 options.accounts.UserNameEdit.decorate(userNameEdit); |
42 userNameEdit.addEventListener('add', this.handleAddUser_); | 42 userNameEdit.addEventListener('add', this.handleAddUser_); |
43 | 43 |
44 // If the current user is not the owner, show some warning, | 44 // If the current user is not the owner, do not show the user list. |
45 // and do not show the user list. | 45 // If the current user is not the owner or the device is enterprise |
James Hawkins
2012/10/24 15:14:41
nit: Insert a comma: "not the owner, or the device
bartfab (slow)
2012/10/24 17:33:51
Done.
| |
46 // managed, show a warning that settings cannot be modified. | |
46 this.showWhitelist_ = UIAccountTweaks.currentUserIsOwner(); | 47 this.showWhitelist_ = UIAccountTweaks.currentUserIsOwner(); |
47 if (this.showWhitelist_) { | 48 if (this.showWhitelist_) { |
48 options.accounts.UserList.decorate(userList); | 49 options.accounts.UserList.decorate(userList); |
49 } else { | 50 } else { |
50 if (!AccountsOptions.whitelistIsManaged()) { | 51 $('ownerOnlyWarning').hidden = false; |
51 $('ownerOnlyWarning').hidden = false; | 52 this.managed = AccountsOptions.whitelistIsManaged(); |
52 } else { | |
53 this.managed = true; | |
54 } | |
55 } | 53 } |
56 | 54 |
57 this.addEventListener('visibleChange', this.handleVisibleChange_); | 55 this.addEventListener('visibleChange', this.handleVisibleChange_); |
58 | 56 |
59 $('useWhitelistCheck').addEventListener('change', | 57 $('useWhitelistCheck').addEventListener('change', |
60 this.handleUseWhitelistCheckChange_.bind(this)); | 58 this.handleUseWhitelistCheckChange_.bind(this)); |
61 | 59 |
62 Preferences.getInstance().addEventListener( | 60 Preferences.getInstance().addEventListener( |
63 $('useWhitelistCheck').pref, | 61 $('useWhitelistCheck').pref, |
64 this.handleUseWhitelistPrefChange_.bind(this)); | 62 this.handleUseWhitelistPrefChange_.bind(this)); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 if (this.showWhitelist_) | 145 if (this.showWhitelist_) |
148 $('userList').updateAccountPicture(username); | 146 $('userList').updateAccountPicture(username); |
149 }; | 147 }; |
150 | 148 |
151 // Export | 149 // Export |
152 return { | 150 return { |
153 AccountsOptions: AccountsOptions | 151 AccountsOptions: AccountsOptions |
154 }; | 152 }; |
155 | 153 |
156 }); | 154 }); |
OLD | NEW |