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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( | 234 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( |
235 profile_path); | 235 profile_path); |
236 if (!profile) | 236 if (!profile) |
237 return; | 237 return; |
238 | 238 |
239 // For guest profiles the browsing data is in the OTR profile. | 239 // For guest profiles the browsing data is in the OTR profile. |
240 if (profile->IsGuestSession()) | 240 if (profile->IsGuestSession()) |
241 profile = profile->GetOffTheRecordProfile(); | 241 profile = profile->GetOffTheRecordProfile(); |
242 | 242 |
243 BrowsingDataRemoverFactory::GetForBrowserContext(profile)->Remove( | 243 BrowsingDataRemoverFactory::GetForBrowserContext(profile)->Remove( |
244 BrowsingDataRemover::Unbounded(), | 244 Unbounded(), BrowsingDataRemover::REMOVE_WIPE_PROFILE, |
245 BrowsingDataRemover::REMOVE_WIPE_PROFILE, BrowsingDataHelper::ALL); | 245 BrowsingDataHelper::ALL); |
246 } | 246 } |
247 | 247 |
248 void SetLastUsedProfile(const std::string& profile_dir) { | 248 void SetLastUsedProfile(const std::string& profile_dir) { |
249 // We should never be saving the System Profile as the last one used since it | 249 // We should never be saving the System Profile as the last one used since it |
250 // shouldn't have a browser. | 250 // shouldn't have a browser. |
251 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) | 251 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) |
252 return; | 252 return; |
253 | 253 |
254 PrefService* local_state = g_browser_process->local_state(); | 254 PrefService* local_state = g_browser_process->local_state(); |
255 DCHECK(local_state); | 255 DCHECK(local_state); |
(...skipping 14 matching lines...) Expand all Loading... |
270 if (!entry->IsSigninRequired() && | 270 if (!entry->IsSigninRequired() && |
271 !entry->IsChild() && | 271 !entry->IsChild() && |
272 !entry->IsLegacySupervised()) { | 272 !entry->IsLegacySupervised()) { |
273 return false; | 273 return false; |
274 } | 274 } |
275 } | 275 } |
276 return all_profiles_locked; | 276 return all_profiles_locked; |
277 } | 277 } |
278 | 278 |
279 } // namespace profiles | 279 } // namespace profiles |
OLD | NEW |