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 #include "chrome/browser/chromeos/login/user_manager.h" | 5 #include "chrome/browser/chromeos/login/user_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Creates new remove attempt for the given user. Note, |delegate| can | 134 // Creates new remove attempt for the given user. Note, |delegate| can |
135 // be NULL. | 135 // be NULL. |
136 RemoveAttempt(const std::string& user_email, | 136 RemoveAttempt(const std::string& user_email, |
137 chromeos::RemoveUserDelegate* delegate) | 137 chromeos::RemoveUserDelegate* delegate) |
138 : user_email_(user_email), | 138 : user_email_(user_email), |
139 delegate_(delegate), | 139 delegate_(delegate), |
140 method_factory_(this) { | 140 method_factory_(this) { |
141 RemoveUser(); | 141 RemoveUser(); |
142 } | 142 } |
143 | 143 |
| 144 virtual ~RemoveAttempt() {} |
| 145 |
144 void RemoveUser() { | 146 void RemoveUser() { |
145 // Owner is not allowed to be removed from the device. | 147 // Owner is not allowed to be removed from the device. |
146 // Must not proceed without signature verification. | 148 // Must not proceed without signature verification. |
147 UserCrosSettingsProvider user_settings; | 149 UserCrosSettingsProvider user_settings; |
148 bool trusted_owner_available = user_settings.RequestTrustedOwner( | 150 bool trusted_owner_available = user_settings.RequestTrustedOwner( |
149 method_factory_.NewRunnableMethod(&RemoveAttempt::RemoveUser)); | 151 method_factory_.NewRunnableMethod(&RemoveAttempt::RemoveUser)); |
150 if (!trusted_owner_available) { | 152 if (!trusted_owner_available) { |
151 // Value of owner email is still not verified. | 153 // Value of owner email is still not verified. |
152 // Another attempt will be invoked after verification completion. | 154 // Another attempt will be invoked after verification completion. |
153 return; | 155 return; |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 base::AutoLock lk(current_user_is_owner_lock_); | 635 base::AutoLock lk(current_user_is_owner_lock_); |
634 return current_user_is_owner_; | 636 return current_user_is_owner_; |
635 } | 637 } |
636 | 638 |
637 void UserManager::set_current_user_is_owner(bool current_user_is_owner) { | 639 void UserManager::set_current_user_is_owner(bool current_user_is_owner) { |
638 base::AutoLock lk(current_user_is_owner_lock_); | 640 base::AutoLock lk(current_user_is_owner_lock_); |
639 current_user_is_owner_ = current_user_is_owner; | 641 current_user_is_owner_ = current_user_is_owner; |
640 } | 642 } |
641 | 643 |
642 } // namespace chromeos | 644 } // namespace chromeos |
OLD | NEW |