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

Side by Side Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 380643002: Profile picture doesn't display correctly after new profile has been created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patch Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_info_cache.h" 5 #include "chrome/browser/profiles/profile_info_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // Default value for whether background apps are running is false. 222 // Default value for whether background apps are running is false.
223 info->SetBoolean(kBackgroundAppsKey, false); 223 info->SetBoolean(kBackgroundAppsKey, false);
224 info->SetString(kSupervisedUserId, supervised_user_id); 224 info->SetString(kSupervisedUserId, supervised_user_id);
225 info->SetBoolean(kIsOmittedFromProfileListKey, !supervised_user_id.empty()); 225 info->SetBoolean(kIsOmittedFromProfileListKey, !supervised_user_id.empty());
226 info->SetBoolean(kProfileIsEphemeral, false); 226 info->SetBoolean(kProfileIsEphemeral, false);
227 info->SetBoolean(kIsUsingDefaultName, IsDefaultName(name)); 227 info->SetBoolean(kIsUsingDefaultName, IsDefaultName(name));
228 cache->SetWithoutPathExpansion(key, info.release()); 228 cache->SetWithoutPathExpansion(key, info.release());
229 229
230 sorted_keys_.insert(FindPositionForProfile(key, name), key); 230 sorted_keys_.insert(FindPositionForProfile(key, name), key);
231 231
232 if (switches::IsNewAvatarMenu())
233 DownloadHighResAvatar(icon_index, profile_path);
234
232 FOR_EACH_OBSERVER(ProfileInfoCacheObserver, 235 FOR_EACH_OBSERVER(ProfileInfoCacheObserver,
233 observer_list_, 236 observer_list_,
234 OnProfileAdded(profile_path)); 237 OnProfileAdded(profile_path));
235 238
236 content::NotificationService::current()->Notify( 239 content::NotificationService::current()->Notify(
237 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, 240 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED,
238 content::NotificationService::AllSources(), 241 content::NotificationService::AllSources(),
239 content::NotificationService::NoDetails()); 242 content::NotificationService::NoDetails());
240 } 243 }
241 244
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 OnProfileAvatarChanged(profile_path)); 1023 OnProfileAvatarChanged(profile_path));
1021 1024
1022 // Remove the file from the list of downloads in progress. Note that this list 1025 // Remove the file from the list of downloads in progress. Note that this list
1023 // only contains the high resolution avatars, and not the Gaia profile images. 1026 // only contains the high resolution avatars, and not the Gaia profile images.
1024 if (!avatar_images_downloads_in_progress_[file_name]) 1027 if (!avatar_images_downloads_in_progress_[file_name])
1025 return; 1028 return;
1026 1029
1027 delete avatar_images_downloads_in_progress_[file_name]; 1030 delete avatar_images_downloads_in_progress_[file_name];
1028 avatar_images_downloads_in_progress_[file_name] = NULL; 1031 avatar_images_downloads_in_progress_[file_name] = NULL;
1029 } 1032 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698