| 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 service->CancelDownloads(); | 800 service->CancelDownloads(); |
| 801 DCHECK_EQ(0, service->NonMaliciousDownloadCount()); | 801 DCHECK_EQ(0, service->NonMaliciousDownloadCount()); |
| 802 | 802 |
| 803 // Close all browser windows before deleting the profile. If the user | 803 // Close all browser windows before deleting the profile. If the user |
| 804 // cancels the closing of any tab in an OnBeforeUnload event, profile | 804 // cancels the closing of any tab in an OnBeforeUnload event, profile |
| 805 // deletion is also cancelled. (crbug.com/289390) | 805 // deletion is also cancelled. (crbug.com/289390) |
| 806 BrowserList::CloseAllBrowsersWithProfile( | 806 BrowserList::CloseAllBrowsersWithProfile( |
| 807 profile, | 807 profile, |
| 808 base::Bind(&ProfileManager::EnsureActiveProfileExistsBeforeDeletion, | 808 base::Bind(&ProfileManager::EnsureActiveProfileExistsBeforeDeletion, |
| 809 base::Unretained(this), callback), | 809 base::Unretained(this), callback), |
| 810 base::Bind(&CancelProfileDeletion)); | 810 base::Bind(&CancelProfileDeletion), false); |
| 811 } else { | 811 } else { |
| 812 EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir); | 812 EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir); |
| 813 } | 813 } |
| 814 } | 814 } |
| 815 #endif // !defined(OS_ANDROID) | 815 #endif // !defined(OS_ANDROID) |
| 816 | 816 |
| 817 void ProfileManager::AutoloadProfiles() { | 817 void ProfileManager::AutoloadProfiles() { |
| 818 // If running in the background is disabled for the browser, do not autoload | 818 // If running in the background is disabled for the browser, do not autoload |
| 819 // any profiles. | 819 // any profiles. |
| 820 PrefService* local_state = g_browser_process->local_state(); | 820 PrefService* local_state = g_browser_process->local_state(); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 | 1721 |
| 1722 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1722 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
| 1723 if (!original_callback.is_null()) | 1723 if (!original_callback.is_null()) |
| 1724 original_callback.Run(loaded_profile, status); | 1724 original_callback.Run(loaded_profile, status); |
| 1725 } | 1725 } |
| 1726 #endif // !defined(OS_ANDROID) | 1726 #endif // !defined(OS_ANDROID) |
| 1727 | 1727 |
| 1728 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1728 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1729 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1729 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1730 } | 1730 } |
| OLD | NEW |