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 <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 724 ProfileShortcutManager* ProfileManager::profile_shortcut_manager() { | 724 ProfileShortcutManager* ProfileManager::profile_shortcut_manager() { |
| 725 return profile_shortcut_manager_.get(); | 725 return profile_shortcut_manager_.get(); |
| 726 } | 726 } |
| 727 | 727 |
| 728 #if !defined(OS_ANDROID) | 728 #if !defined(OS_ANDROID) |
| 729 void ProfileManager::ScheduleProfileForDeletion( | 729 void ProfileManager::ScheduleProfileForDeletion( |
| 730 const base::FilePath& profile_dir, | 730 const base::FilePath& profile_dir, |
| 731 const CreateCallback& callback) { | 731 const CreateCallback& callback) { |
| 732 DCHECK(profiles::IsMultipleProfilesEnabled()); | 732 DCHECK(profiles::IsMultipleProfilesEnabled()); |
| 733 | 733 |
| 734 if (IsProfileMarkedForDeletion(profile_dir)) { | |
| 735 LOG(WARNING) << "Profile already marked for deletion: " | |
| 736 << profile_dir.value(); | |
| 737 return; | |
|
Dan Beam
2016/05/13 03:39:31
i vote for this solution but without error and usi
| |
| 738 } | |
| 739 | |
| 734 // Cancel all in-progress downloads before deleting the profile to prevent a | 740 // Cancel all in-progress downloads before deleting the profile to prevent a |
| 735 // "Do you want to exit Google Chrome and cancel the downloads?" prompt | 741 // "Do you want to exit Google Chrome and cancel the downloads?" prompt |
| 736 // (crbug.com/336725). | 742 // (crbug.com/336725). |
| 737 Profile* profile = GetProfileByPath(profile_dir); | 743 Profile* profile = GetProfileByPath(profile_dir); |
| 738 if (profile) { | 744 if (profile) { |
| 739 DownloadService* service = | 745 DownloadService* service = |
| 740 DownloadServiceFactory::GetForBrowserContext(profile); | 746 DownloadServiceFactory::GetForBrowserContext(profile); |
| 741 service->CancelDownloads(); | 747 service->CancelDownloads(); |
| 742 } | 748 } |
| 743 | 749 |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1624 | 1630 |
| 1625 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1631 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
| 1626 if (!original_callback.is_null()) | 1632 if (!original_callback.is_null()) |
| 1627 original_callback.Run(loaded_profile, status); | 1633 original_callback.Run(loaded_profile, status); |
| 1628 } | 1634 } |
| 1629 #endif // !defined(OS_ANDROID) | 1635 #endif // !defined(OS_ANDROID) |
| 1630 | 1636 |
| 1631 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1637 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1632 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1638 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1633 } | 1639 } |
| OLD | NEW |