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

Side by Side Diff: chrome/browser/chromeos/login/user_image_manager_impl.cc

Issue 15684005: Do not reset LM user image on first signin (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix if/else Created 7 years, 6 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 | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698