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

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

Issue 12300036: Fix spurious profile shortcuts created with a system-level install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_shortcut_manager_win.cc
===================================================================
--- chrome/browser/profiles/profile_shortcut_manager_win.cc (revision 183222)
+++ chrome/browser/profiles/profile_shortcut_manager_win.cc (working copy)
@@ -616,14 +616,26 @@
void ProfileShortcutManagerWin::OnProfileNameChanged(
const base::FilePath& profile_path,
const string16& old_profile_name) {
- CreateOrUpdateShortcutsForProfileAtPath(profile_path, UPDATE_EXISTING_ONLY,
- IGNORE_NON_PROFILE_SHORTCUTS);
+ // Don't update any shortcuts if none were ever created, as indicated by no
+ // shortcut name being set in the profile info cache.
+ const ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
+ const size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path);
+ if (!cache.GetShortcutNameOfProfileAtIndex(profile_index).empty()) {
sail 2013/02/20 00:03:52 You already have UPDATE_EXISTING_ONLY and you pass
Alexei Svitkine (slow) 2013/02/20 00:21:16 See the call in the "else if" in OnProfileAdded().
+ CreateOrUpdateShortcutsForProfileAtPath(profile_path, UPDATE_EXISTING_ONLY,
+ IGNORE_NON_PROFILE_SHORTCUTS);
+ }
}
void ProfileShortcutManagerWin::OnProfileAvatarChanged(
const base::FilePath& profile_path) {
- CreateOrUpdateShortcutsForProfileAtPath(profile_path, UPDATE_EXISTING_ONLY,
- IGNORE_NON_PROFILE_SHORTCUTS);
+ // Don't update any shortcuts if none were ever created, as indicated by no
+ // shortcut name being set in the profile info cache.
+ const ProfileInfoCache& cache = profile_manager_->GetProfileInfoCache();
+ const size_t profile_index = cache.GetIndexOfProfileWithPath(profile_path);
+ if (!cache.GetShortcutNameOfProfileAtIndex(profile_index).empty()) {
+ CreateOrUpdateShortcutsForProfileAtPath(profile_path, UPDATE_EXISTING_ONLY,
+ IGNORE_NON_PROFILE_SHORTCUTS);
+ }
}
base::FilePath ProfileShortcutManagerWin::GetOtherProfilePath(
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698