OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/login/user_image_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_image_manager_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 NOTREACHED(); | 260 NOTREACHED(); |
261 } | 261 } |
262 } | 262 } |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 void UserImageManagerImpl::UserLoggedIn(const std::string& email, | 266 void UserImageManagerImpl::UserLoggedIn(const std::string& email, |
267 bool user_is_new, | 267 bool user_is_new, |
268 bool user_is_local) { | 268 bool user_is_local) { |
269 if (user_is_new) { | 269 if (user_is_new) { |
270 SetInitialUserImage(email); | 270 if (!user_is_local) |
| 271 SetInitialUserImage(email); |
271 } else { | 272 } else { |
272 User* user = UserManager::Get()->GetLoggedInUser(); | 273 User* user = UserManager::Get()->GetLoggedInUser(); |
273 | 274 |
274 if (!user_is_local) { | 275 if (!user_is_local) { |
275 // If current user image is profile image, it needs to be refreshed. | 276 // If current user image is profile image, it needs to be refreshed. |
276 bool download_profile_image = | 277 bool download_profile_image = |
277 user->image_index() == User::kProfileImageIndex; | 278 user->image_index() == User::kProfileImageIndex; |
278 if (download_profile_image) | 279 if (download_profile_image) |
279 InitDownloadedProfileImage(); | 280 InitDownloadedProfileImage(); |
280 | 281 |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 if (prefs_images_update->GetDictionaryWithoutPathExpansion( | 774 if (prefs_images_update->GetDictionaryWithoutPathExpansion( |
774 username, &image_properties)) { | 775 username, &image_properties)) { |
775 std::string image_path; | 776 std::string image_path; |
776 image_properties->GetString(kImagePathNodeName, &image_path); | 777 image_properties->GetString(kImagePathNodeName, &image_path); |
777 prefs_images_update->RemoveWithoutPathExpansion(username, NULL); | 778 prefs_images_update->RemoveWithoutPathExpansion(username, NULL); |
778 DeleteImageFile(image_path); | 779 DeleteImageFile(image_path); |
779 } | 780 } |
780 } | 781 } |
781 | 782 |
782 } // namespace chromeos | 783 } // namespace chromeos |
OLD | NEW |