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

Side by Side Diff: components/user_manager/fake_user_manager.cc

Issue 2711113003: Track whether a given user session has completed initialization, and use (Closed)
Patch Set: Only expose known_user::RemovePrefsForTesting() for tests Created 3 years, 9 months 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
« no previous file with comments | « components/user_manager/fake_user_manager.h ('k') | components/user_manager/known_user.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/user_manager/fake_user_manager.h" 5 #include "components/user_manager/fake_user_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 const user_manager::User* FakeUserManager::AddUserWithAffiliation( 48 const user_manager::User* FakeUserManager::AddUserWithAffiliation(
49 const AccountId& account_id, 49 const AccountId& account_id,
50 bool is_affiliated) { 50 bool is_affiliated) {
51 user_manager::User* user = user_manager::User::CreateRegularUser(account_id); 51 user_manager::User* user = user_manager::User::CreateRegularUser(account_id);
52 user->SetAffiliation(is_affiliated); 52 user->SetAffiliation(is_affiliated);
53 users_.push_back(user); 53 users_.push_back(user);
54 return user; 54 return user;
55 } 55 }
56 56
57 void FakeUserManager::OnProfileInitialized(User* user) {
58 user->set_profile_ever_initialized(true);
59 }
60
57 void FakeUserManager::RemoveUserFromList(const AccountId& account_id) { 61 void FakeUserManager::RemoveUserFromList(const AccountId& account_id) {
58 const user_manager::UserList::iterator it = 62 const user_manager::UserList::iterator it =
59 std::find_if(users_.begin(), users_.end(), 63 std::find_if(users_.begin(), users_.end(),
60 [&account_id](const user_manager::User* user) { 64 [&account_id](const user_manager::User* user) {
61 return user->GetAccountId() == account_id; 65 return user->GetAccountId() == account_id;
62 }); 66 });
63 if (it != users_.end()) { 67 if (it != users_.end()) {
64 if (primary_user_ == *it) 68 if (primary_user_ == *it)
65 primary_user_ = nullptr; 69 primary_user_ = nullptr;
66 if (active_user_ != *it) 70 if (active_user_ != *it)
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 NOTIMPLEMENTED(); 352 NOTIMPLEMENTED();
349 return; 353 return;
350 } 354 }
351 355
352 bool FakeUserManager::IsValidDefaultUserImageId(int image_index) const { 356 bool FakeUserManager::IsValidDefaultUserImageId(int image_index) const {
353 NOTIMPLEMENTED(); 357 NOTIMPLEMENTED();
354 return false; 358 return false;
355 } 359 }
356 360
357 } // namespace user_manager 361 } // namespace user_manager
OLDNEW
« no previous file with comments | « components/user_manager/fake_user_manager.h ('k') | components/user_manager/known_user.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698