Index: chrome/browser/profiles/profile_manager.cc |
=================================================================== |
--- chrome/browser/profiles/profile_manager.cc (revision 152316) |
+++ chrome/browser/profiles/profile_manager.cc (working copy) |
@@ -269,7 +269,8 @@ |
content::NotificationService::AllSources()); |
if (ProfileShortcutManager::IsFeatureEnabled()) |
- profile_shortcut_manager_.reset(ProfileShortcutManager::Create()); |
+ profile_shortcut_manager_.reset(ProfileShortcutManager::Create( |
+ GetProfileInfoCache())); |
} |
ProfileManager::~ProfileManager() { |
@@ -456,12 +457,10 @@ |
info->callbacks.push_back(callback); |
if (profile_shortcut_manager_.get() && !name.empty() && |
!icon_url.empty()) { |
- BrowserThread::PostTask( |
- BrowserThread::FILE, FROM_HERE, |
- base::Bind(&ProfileShortcutManager::CreateChromeDesktopShortcut, |
- base::Unretained(profile_shortcut_manager_.get()), profile_path, name, |
+ profile_shortcut_manager_->StartProfileDesktopShortcutCreation( |
+ profile_path, name, |
ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
- cache.GetDefaultAvatarIconResourceIDAtIndex(icon_index)))); |
+ cache.GetDefaultAvatarIconResourceIDAtIndex(icon_index))); |
} |
} |
} |
@@ -954,13 +953,15 @@ |
} |
} |
+ // Delete possible shortcuts for this profile |
+ if (profile_shortcut_manager_.get()) |
+ profile_shortcut_manager_->DeleteProfileDesktopShortcut( |
+ profile_dir, cache.GetNameOfProfileAtIndex( |
+ cache.GetIndexOfProfileWithPath(profile_dir))); |
+ |
QueueProfileDirectoryForDeletion(profile_dir); |
cache.DeleteProfileFromCache(profile_dir); |
- // Delete possible shortcuts for this profile |
- if (profile_shortcut_manager_.get()) |
- profile_shortcut_manager_->DeleteChromeDesktopShortcut(profile_dir); |
- |
ProfileMetrics::LogNumberOfProfiles(this, |
ProfileMetrics::DELETE_PROFILE_EVENT); |
} |