Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 10837352: Update profile desktop shortcuts (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698