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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 PasswordStoreFactory::GetForProfile( | 1503 PasswordStoreFactory::GetForProfile( |
| 1504 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); | 1504 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 1505 if (password_store.get()) { | 1505 if (password_store.get()) { |
| 1506 password_store->RemoveLoginsCreatedBetween( | 1506 password_store->RemoveLoginsCreatedBetween( |
| 1507 base::Time(), base::Time::Max(), base::Closure()); | 1507 base::Time(), base::Time::Max(), base::Closure()); |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 // The Profile Data doesn't get wiped until Chrome closes. Since we promised | 1510 // The Profile Data doesn't get wiped until Chrome closes. Since we promised |
| 1511 // that the user's data would be removed, do so immediately. | 1511 // that the user's data would be removed, do so immediately. |
| 1512 profiles::RemoveBrowsingDataForProfile(profile_dir); | 1512 profiles::RemoveBrowsingDataForProfile(profile_dir); |
| 1513 | |
| 1514 // Clean-up pref data that won't be cleaned up by NukeProfileFromDisk. | |
| 1515 profile->GetPrefs()->OnStoreDeletionFromDisk(); | |
| 1513 } else { | 1516 } else { |
| 1514 // It is safe to delete a not yet loaded Profile from disk. | 1517 // It is safe to delete a not yet loaded Profile from disk. |
|
gab
2017/06/06 14:48:26
The logic will go through here if the user deletes
proberge
2017/06/07 19:22:50
Done. Note that this involves added complexity to
| |
| 1515 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 1518 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 1516 base::BindOnce(&NukeProfileFromDisk, profile_dir)); | 1519 base::BindOnce(&NukeProfileFromDisk, profile_dir)); |
| 1517 } | 1520 } |
| 1518 | 1521 |
| 1519 // Queue even a profile that was nuked so it will be MarkedForDeletion and so | 1522 // Queue even a profile that was nuked so it will be MarkedForDeletion and so |
| 1520 // CreateProfileAsync can't create it. | 1523 // CreateProfileAsync can't create it. |
| 1521 MarkProfileDirectoryForDeletion(profile_dir); | 1524 MarkProfileDirectoryForDeletion(profile_dir); |
| 1522 storage.RemoveProfile(profile_dir); | 1525 storage.RemoveProfile(profile_dir); |
| 1523 ProfileMetrics::UpdateReportedProfilesStatistics(this); | 1526 ProfileMetrics::UpdateReportedProfilesStatistics(this); |
| 1524 } | 1527 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1781 | 1784 |
| 1782 const base::FilePath new_active_profile_dir = | 1785 const base::FilePath new_active_profile_dir = |
| 1783 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); | 1786 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); |
| 1784 FinishDeletingProfile(profile_dir, new_active_profile_dir); | 1787 FinishDeletingProfile(profile_dir, new_active_profile_dir); |
| 1785 } | 1788 } |
| 1786 #endif // !defined(OS_ANDROID) | 1789 #endif // !defined(OS_ANDROID) |
| 1787 | 1790 |
| 1788 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1791 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1789 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1792 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1790 } | 1793 } |
| OLD | NEW |