Chromium Code Reviews| 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 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 | 36 |
| 37 var userNameEdit = $('userNameEdit'); | 37 var userNameEdit = $('userNameEdit'); |
| 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 options.accounts.UserList.decorate(userList); | |
| 45 } else { | |
| 44 if (!AccountsOptions.whitelistIsManaged()) { | 46 if (!AccountsOptions.whitelistIsManaged()) { |
| 45 options.accounts.UserList.decorate(userList); | 47 $('ownerOnlyWarning').hidden = false; |
| 48 } else { | |
| 49 this.managed = true; | |
| 50 OptionsPage.updateManagedBannerVisibility(); | |
|
Mattias Nissler (ping if slow)
2011/06/15 15:02:59
Is this call really needed? I guess you should als
pastarmovj
2011/06/15 15:57:07
You are right not needed here.
| |
| 46 } | 51 } |
| 47 } else { | |
| 48 $('ownerOnlyWarning').hidden = false; | |
| 49 } | 52 } |
| 50 | 53 |
| 51 this.addEventListener('visibleChange', this.handleVisibleChange_); | 54 this.addEventListener('visibleChange', this.handleVisibleChange_); |
| 52 | 55 |
| 53 $('useWhitelistCheck').addEventListener('change', | 56 $('useWhitelistCheck').addEventListener('change', |
| 54 this.handleUseWhitelistCheckChange_.bind(this)); | 57 this.handleUseWhitelistCheckChange_.bind(this)); |
| 55 | 58 |
| 56 Preferences.getInstance().addEventListener( | 59 Preferences.getInstance().addEventListener( |
| 57 $('useWhitelistCheck').pref, | 60 $('useWhitelistCheck').pref, |
| 58 this.handleUseWhitelistPrefChange_.bind(this)); | 61 this.handleUseWhitelistPrefChange_.bind(this)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 var userList = $('userList'); | 153 var userList = $('userList'); |
| 151 userList.updateAccountPicture(email, imageUrl); | 154 userList.updateAccountPicture(email, imageUrl); |
| 152 }; | 155 }; |
| 153 | 156 |
| 154 // Export | 157 // Export |
| 155 return { | 158 return { |
| 156 AccountsOptions: AccountsOptions | 159 AccountsOptions: AccountsOptions |
| 157 }; | 160 }; |
| 158 | 161 |
| 159 }); | 162 }); |
| OLD | NEW |