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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 return true; | 1078 return true; |
1079 } | 1079 } |
1080 | 1080 |
1081 void ProfileManager::FinishDeletingProfile(const base::FilePath& profile_dir) { | 1081 void ProfileManager::FinishDeletingProfile(const base::FilePath& profile_dir) { |
1082 ProfileInfoCache& cache = GetProfileInfoCache(); | 1082 ProfileInfoCache& cache = GetProfileInfoCache(); |
1083 // TODO(sail): Due to bug 88586 we don't delete the profile instance. Once we | 1083 // TODO(sail): Due to bug 88586 we don't delete the profile instance. Once we |
1084 // start deleting the profile instance we need to close background apps too. | 1084 // start deleting the profile instance we need to close background apps too. |
1085 Profile* profile = GetProfileByPath(profile_dir); | 1085 Profile* profile = GetProfileByPath(profile_dir); |
1086 | 1086 |
1087 if (profile) { | 1087 if (profile) { |
1088 // TODO: Migrate additional code in this block to observe this notification | |
1089 // instead of being implemented here. | |
1090 content::NotificationService::current()->Notify( | |
1091 chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, | |
1092 content::Source<Profile>(profile), | |
1093 content::NotificationService::NoDetails()); | |
1094 | |
1095 // By this point, all in-progress downloads for the profile being deleted | 1088 // By this point, all in-progress downloads for the profile being deleted |
1096 // must have been canceled (crbug.com/336725). | 1089 // must have been canceled (crbug.com/336725). |
1097 DCHECK(DownloadServiceFactory::GetForBrowserContext(profile)-> | 1090 DCHECK(DownloadServiceFactory::GetForBrowserContext(profile)-> |
1098 NonMaliciousDownloadCount() == 0); | 1091 NonMaliciousDownloadCount() == 0); |
1099 BrowserList::CloseAllBrowsersWithProfile(profile); | 1092 BrowserList::CloseAllBrowsersWithProfile(profile); |
1100 | 1093 |
1101 // Disable sync for doomed profile. | 1094 // Disable sync for doomed profile. |
1102 if (ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService( | 1095 if (ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService( |
1103 profile)) { | 1096 profile)) { |
1104 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 1097 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 last_non_managed_profile_path.BaseName().MaybeAsASCII()); | 1286 last_non_managed_profile_path.BaseName().MaybeAsASCII()); |
1294 FinishDeletingProfile(profile_to_delete_path); | 1287 FinishDeletingProfile(profile_to_delete_path); |
1295 } | 1288 } |
1296 } | 1289 } |
1297 } | 1290 } |
1298 #endif | 1291 #endif |
1299 | 1292 |
1300 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1293 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1301 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1294 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1302 } | 1295 } |
OLD | NEW |