Chromium Code Reviews| 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( |