OLD | NEW |
---|---|
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 FOR_EACH_OBSERVER(ProfileInfoCacheObserver, | 232 FOR_EACH_OBSERVER(ProfileInfoCacheObserver, |
233 observer_list_, | 233 observer_list_, |
234 OnProfileAdded(profile_path)); | 234 OnProfileAdded(profile_path)); |
235 | 235 |
236 if (switches::IsNewAvatarMenu()) | |
noms (inactive)
2014/07/11 13:47:56
I'm sorry, I didn't see this initially because the
Malcolm
2014/07/11 14:18:44
You are right, this should be done before notifica
noms (inactive)
2014/07/11 15:59:11
Default arguments are not allowed in Chromium, unf
| |
237 DownloadHighResAvatar(icon_index, profile_path); | |
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 |
242 void ProfileInfoCache::AddObserver(ProfileInfoCacheObserver* obs) { | 245 void ProfileInfoCache::AddObserver(ProfileInfoCacheObserver* obs) { |
243 observer_list_.AddObserver(obs); | 246 observer_list_.AddObserver(obs); |
244 } | 247 } |
245 | 248 |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 OnProfileAvatarChanged(profile_path)); | 1013 OnProfileAvatarChanged(profile_path)); |
1011 | 1014 |
1012 // Remove the file from the list of downloads in progress. Note that this list | 1015 // Remove the file from the list of downloads in progress. Note that this list |
1013 // only contains the high resolution avatars, and not the Gaia profile images. | 1016 // only contains the high resolution avatars, and not the Gaia profile images. |
1014 if (!avatar_images_downloads_in_progress_[file_name]) | 1017 if (!avatar_images_downloads_in_progress_[file_name]) |
1015 return; | 1018 return; |
1016 | 1019 |
1017 delete avatar_images_downloads_in_progress_[file_name]; | 1020 delete avatar_images_downloads_in_progress_[file_name]; |
1018 avatar_images_downloads_in_progress_[file_name] = NULL; | 1021 avatar_images_downloads_in_progress_[file_name] = NULL; |
1019 } | 1022 } |
OLD | NEW |