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

Side by Side Diff: chrome/browser/profiles/profiles_state.cc

Issue 847733005: Move User Manager onto a System profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/profiles/profiles_state.h" 5 #include "chrome/browser/profiles/profiles_state.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/prefs/pref_registry_simple.h" 8 #include "base/prefs/pref_registry_simple.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 if (active_profile->IsGuestSession()) 178 if (active_profile->IsGuestSession())
179 return active_profile; 179 return active_profile;
180 180
181 ProfileManager* profile_manager = g_browser_process->profile_manager(); 181 ProfileManager* profile_manager = g_browser_process->profile_manager();
182 const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); 182 const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
183 size_t index = cache.GetIndexOfProfileWithPath(active_profile->GetPath()); 183 size_t index = cache.GetIndexOfProfileWithPath(active_profile->GetPath());
184 if (!cache.ProfileIsSigninRequiredAtIndex(index)) 184 if (!cache.ProfileIsSigninRequiredAtIndex(index))
185 return NULL; 185 return NULL;
186 186
187 // The guest profile must have been loaded already. 187 // Profile loads synchronously if it was not previously created.
188 Profile* guest_profile = profile_manager->GetProfile( 188 Profile* guest_profile = profile_manager->GetProfile(
189 ProfileManager::GetGuestProfilePath()); 189 ProfileManager::GetGuestProfilePath());
190 DCHECK(guest_profile); 190 DCHECK(guest_profile);
191 191
192 PrefService* local_state = g_browser_process->local_state(); 192 PrefService* local_state = g_browser_process->local_state();
193 DCHECK(local_state); 193 DCHECK(local_state);
194 local_state->SetString(prefs::kProfileLastUsed, 194 local_state->SetString(prefs::kProfileLastUsed,
195 guest_profile->GetPath().BaseName().MaybeAsASCII()); 195 guest_profile->GetPath().BaseName().MaybeAsASCII());
196 return guest_profile; 196 return guest_profile;
197 } 197 }
198 198
199 } // namespace profiles 199 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_window.cc ('k') | chrome/browser/ui/cocoa/profiles/user_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698