OLD | NEW |
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 SigninErrorController* GetSigninErrorController(Profile* profile) { | 197 SigninErrorController* GetSigninErrorController(Profile* profile) { |
198 return SigninErrorControllerFactory::GetForProfile(profile); | 198 return SigninErrorControllerFactory::GetForProfile(profile); |
199 } | 199 } |
200 | 200 |
201 bool SetActiveProfileToGuestIfLocked() { | 201 bool SetActiveProfileToGuestIfLocked() { |
202 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 202 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
203 | 203 |
204 const base::FilePath& active_profile_path = | 204 const base::FilePath& active_profile_path = |
205 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); | 205 profile_manager->GetLastUsedProfileDir(); |
206 const base::FilePath& guest_path = ProfileManager::GetGuestProfilePath(); | 206 const base::FilePath& guest_path = ProfileManager::GetGuestProfilePath(); |
207 if (active_profile_path == guest_path) | 207 if (active_profile_path == guest_path) |
208 return true; | 208 return true; |
209 | 209 |
210 const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); | 210 const ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
211 size_t index = cache.GetIndexOfProfileWithPath(active_profile_path); | 211 size_t index = cache.GetIndexOfProfileWithPath(active_profile_path); |
212 if (!cache.ProfileIsSigninRequiredAtIndex(index)) | 212 if (!cache.ProfileIsSigninRequiredAtIndex(index)) |
213 return false; | 213 return false; |
214 | 214 |
215 PrefService* local_state = g_browser_process->local_state(); | 215 PrefService* local_state = g_browser_process->local_state(); |
(...skipping 18 matching lines...) Expand all Loading... |
234 // For guest the browsing data is in the OTR profile. | 234 // For guest the browsing data is in the OTR profile. |
235 if (profile->IsGuestSession()) | 235 if (profile->IsGuestSession()) |
236 profile = profile->GetOffTheRecordProfile(); | 236 profile = profile->GetOffTheRecordProfile(); |
237 | 237 |
238 BrowsingDataRemover::CreateForUnboundedRange(profile)->Remove( | 238 BrowsingDataRemover::CreateForUnboundedRange(profile)->Remove( |
239 BrowsingDataRemover::REMOVE_ALL, BrowsingDataHelper::ALL); | 239 BrowsingDataRemover::REMOVE_ALL, BrowsingDataHelper::ALL); |
240 // BrowsingDataRemover deletes itself. | 240 // BrowsingDataRemover deletes itself. |
241 } | 241 } |
242 | 242 |
243 } // namespace profiles | 243 } // namespace profiles |
OLD | NEW |