Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profile_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1484 if (sync_service->IsSyncRequested()) { | 1484 if (sync_service->IsSyncRequested()) { |
| 1485 // Record sync stopped by profile destruction if it was on before. | 1485 // Record sync stopped by profile destruction if it was on before. |
| 1486 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", | 1486 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", |
| 1487 syncer::PROFILE_DESTRUCTION, | 1487 syncer::PROFILE_DESTRUCTION, |
| 1488 syncer::STOP_SOURCE_LIMIT); | 1488 syncer::STOP_SOURCE_LIMIT); |
| 1489 } | 1489 } |
| 1490 // Ensure data is cleared even if sync was already off. | 1490 // Ensure data is cleared even if sync was already off. |
| 1491 ProfileSyncServiceFactory::GetInstance() | 1491 ProfileSyncServiceFactory::GetInstance() |
| 1492 ->GetForProfile(profile) | 1492 ->GetForProfile(profile) |
| 1493 ->RequestStop(browser_sync::ProfileSyncService::CLEAR_DATA); | 1493 ->RequestStop(browser_sync::ProfileSyncService::CLEAR_DATA); |
| 1494 | |
| 1495 // Clean-up pref data that won't be cleaned up by NukeProfileFromDisk. | |
| 1496 profile->GetPrefs()->CleanupForProfileDeletion(); | |
|
gab
2017/06/05 17:28:57
Why is this inside if (ProfileSyncServiceFactory::
proberge
2017/06/05 21:22:11
My bad, I thought I put it under if (profile) {}.
| |
| 1494 } | 1497 } |
| 1495 | 1498 |
| 1496 ProfileAttributesEntry* entry; | 1499 ProfileAttributesEntry* entry; |
| 1497 bool has_entry = storage.GetProfileAttributesWithPath(profile_dir, &entry); | 1500 bool has_entry = storage.GetProfileAttributesWithPath(profile_dir, &entry); |
| 1498 DCHECK(has_entry); | 1501 DCHECK(has_entry); |
| 1499 ProfileMetrics::LogProfileDelete(entry->IsAuthenticated()); | 1502 ProfileMetrics::LogProfileDelete(entry->IsAuthenticated()); |
| 1500 // Some platforms store passwords in keychains. They should be removed. | 1503 // Some platforms store passwords in keychains. They should be removed. |
| 1501 scoped_refptr<password_manager::PasswordStore> password_store = | 1504 scoped_refptr<password_manager::PasswordStore> password_store = |
| 1502 PasswordStoreFactory::GetForProfile( | 1505 PasswordStoreFactory::GetForProfile( |
| 1503 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); | 1506 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1780 | 1783 |
| 1781 const base::FilePath new_active_profile_dir = | 1784 const base::FilePath new_active_profile_dir = |
| 1782 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); | 1785 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); |
| 1783 FinishDeletingProfile(profile_dir, new_active_profile_dir); | 1786 FinishDeletingProfile(profile_dir, new_active_profile_dir); |
| 1784 } | 1787 } |
| 1785 #endif // !defined(OS_ANDROID) | 1788 #endif // !defined(OS_ANDROID) |
| 1786 | 1789 |
| 1787 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1790 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1788 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1791 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1789 } | 1792 } |
| OLD | NEW |