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