Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 8588006: Eliminate CrosLibrary::EnsureLoaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 delegate_->OnBeforeUserRemoved(user_email_); 122 delegate_->OnBeforeUserRemoved(user_email_);
123 123
124 chromeos::UserManager::Get()->RemoveUserFromList(user_email_); 124 chromeos::UserManager::Get()->RemoveUserFromList(user_email_);
125 RemoveUserCryptohome(); 125 RemoveUserCryptohome();
126 126
127 if (delegate_) 127 if (delegate_)
128 delegate_->OnUserRemoved(user_email_); 128 delegate_->OnUserRemoved(user_email_);
129 } 129 }
130 130
131 void RemoveUserCryptohome() { 131 void RemoveUserCryptohome() {
132 if (CrosLibrary::Get()->EnsureLoaded()) { 132 CrosLibrary::Get()->GetCryptohomeLibrary()->AsyncRemove(user_email_, this);
133 CrosLibrary::Get()->GetCryptohomeLibrary()->AsyncRemove(user_email_,
134 this);
135 }
136 } 133 }
137 134
138 void OnComplete(bool success, int return_code) { 135 void OnComplete(bool success, int return_code) {
139 // Log the error, but there's not much we can do. 136 // Log the error, but there's not much we can do.
140 if (!success) { 137 if (!success) {
141 VLOG(1) << "Removal of cryptohome for " << user_email_ 138 VLOG(1) << "Removal of cryptohome for " << user_email_
142 << " failed, return code: " << return_code; 139 << " failed, return code: " << return_code;
143 } 140 }
144 delete this; 141 delete this;
145 } 142 }
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 854
858 User* UserManager::CreateUser(const std::string& email) const { 855 User* UserManager::CreateUser(const std::string& email) const {
859 User* user = new User(email); 856 User* user = new User(email);
860 user->set_oauth_token_status(GetUserOAuthStatus(email)); 857 user->set_oauth_token_status(GetUserOAuthStatus(email));
861 // Used to determine whether user's display name is unique. 858 // Used to determine whether user's display name is unique.
862 ++display_name_count_[user->GetDisplayName()]; 859 ++display_name_count_[user->GetDisplayName()];
863 return user; 860 return user;
864 } 861 }
865 862
866 } // namespace chromeos 863 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/update_screen_browsertest.cc ('k') | chrome/browser/chromeos/login/version_info_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698