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 <set> |
| 10 |
9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
10 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
12 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 15 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
14 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 16 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
15 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 17 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 18 #include "chrome/browser/browsing_data/chrome_browsing_data_types.h" |
16 #include "chrome/browser/profiles/gaia_info_update_service.h" | 19 #include "chrome/browser/profiles/gaia_info_update_service.h" |
17 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | 20 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
18 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_attributes_entry.h" | 22 #include "chrome/browser/profiles/profile_attributes_entry.h" |
20 #include "chrome/browser/profiles/profile_attributes_storage.h" | 23 #include "chrome/browser/profiles/profile_attributes_storage.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 24 #include "chrome/browser/profiles/profile_manager.h" |
22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 25 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
23 #include "chrome/browser/signin/signin_error_controller_factory.h" | 26 #include "chrome/browser/signin/signin_error_controller_factory.h" |
24 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( | 243 Profile* profile = g_browser_process->profile_manager()->GetProfileByPath( |
241 profile_path); | 244 profile_path); |
242 if (!profile) | 245 if (!profile) |
243 return; | 246 return; |
244 | 247 |
245 // For guest profiles the browsing data is in the OTR profile. | 248 // For guest profiles the browsing data is in the OTR profile. |
246 if (profile->IsGuestSession()) | 249 if (profile->IsGuestSession()) |
247 profile = profile->GetOffTheRecordProfile(); | 250 profile = profile->GetOffTheRecordProfile(); |
248 | 251 |
249 BrowsingDataRemoverFactory::GetForBrowserContext(profile)->Remove( | 252 BrowsingDataRemoverFactory::GetForBrowserContext(profile)->Remove( |
250 base::Time(), base::Time::Max(), | 253 base::Time(), base::Time::Max(), BrowsingDataTypeSetWipeProfile(), |
251 BrowsingDataRemover::REMOVE_WIPE_PROFILE, BrowsingDataHelper::ALL); | 254 BrowsingDataHelper::ALL); |
252 } | 255 } |
253 | 256 |
254 void SetLastUsedProfile(const std::string& profile_dir) { | 257 void SetLastUsedProfile(const std::string& profile_dir) { |
255 // We should never be saving the System Profile as the last one used since it | 258 // We should never be saving the System Profile as the last one used since it |
256 // shouldn't have a browser. | 259 // shouldn't have a browser. |
257 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) | 260 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) |
258 return; | 261 return; |
259 | 262 |
260 PrefService* local_state = g_browser_process->local_state(); | 263 PrefService* local_state = g_browser_process->local_state(); |
261 DCHECK(local_state); | 264 DCHECK(local_state); |
(...skipping 24 matching lines...) Expand all Loading... |
286 bool IsPublicSession() { | 289 bool IsPublicSession() { |
287 #if defined(OS_CHROMEOS) | 290 #if defined(OS_CHROMEOS) |
288 if (chromeos::LoginState::IsInitialized()) { | 291 if (chromeos::LoginState::IsInitialized()) { |
289 return chromeos::LoginState::Get()->IsPublicSessionUser(); | 292 return chromeos::LoginState::Get()->IsPublicSessionUser(); |
290 } | 293 } |
291 #endif | 294 #endif |
292 return false; | 295 return false; |
293 } | 296 } |
294 | 297 |
295 } // namespace profiles | 298 } // namespace profiles |
OLD | NEW |