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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 service->CancelDownloads(); | 813 service->CancelDownloads(); |
814 DCHECK_EQ(0, service->NonMaliciousDownloadCount()); | 814 DCHECK_EQ(0, service->NonMaliciousDownloadCount()); |
815 | 815 |
816 // Close all browser windows before deleting the profile. If the user | 816 // Close all browser windows before deleting the profile. If the user |
817 // cancels the closing of any tab in an OnBeforeUnload event, profile | 817 // cancels the closing of any tab in an OnBeforeUnload event, profile |
818 // deletion is also cancelled. (crbug.com/289390) | 818 // deletion is also cancelled. (crbug.com/289390) |
819 BrowserList::CloseAllBrowsersWithProfile( | 819 BrowserList::CloseAllBrowsersWithProfile( |
820 profile, | 820 profile, |
821 base::Bind(&ProfileManager::EnsureActiveProfileExistsBeforeDeletion, | 821 base::Bind(&ProfileManager::EnsureActiveProfileExistsBeforeDeletion, |
822 base::Unretained(this), callback), | 822 base::Unretained(this), callback), |
823 base::Bind(&CancelProfileDeletion)); | 823 base::Bind(&CancelProfileDeletion), false); |
824 } else { | 824 } else { |
825 EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir); | 825 EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir); |
826 } | 826 } |
827 } | 827 } |
828 #endif // !defined(OS_ANDROID) | 828 #endif // !defined(OS_ANDROID) |
829 | 829 |
830 void ProfileManager::AutoloadProfiles() { | 830 void ProfileManager::AutoloadProfiles() { |
831 // If running in the background is disabled for the browser, do not autoload | 831 // If running in the background is disabled for the browser, do not autoload |
832 // any profiles. | 832 // any profiles. |
833 PrefService* local_state = g_browser_process->local_state(); | 833 PrefService* local_state = g_browser_process->local_state(); |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 | 1765 |
1766 const base::FilePath new_active_profile_dir = | 1766 const base::FilePath new_active_profile_dir = |
1767 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); | 1767 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); |
1768 FinishDeletingProfile(profile_dir, new_active_profile_dir); | 1768 FinishDeletingProfile(profile_dir, new_active_profile_dir); |
1769 } | 1769 } |
1770 #endif // !defined(OS_ANDROID) | 1770 #endif // !defined(OS_ANDROID) |
1771 | 1771 |
1772 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1772 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1773 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1773 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1774 } | 1774 } |
OLD | NEW |