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

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

Issue 10537073: [cros] Fix broken profile image on Options/Change picture page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.h ('k') | 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) 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/chromeos/login/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_manager_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 UMA_HISTOGRAM_ENUMERATION("UserImage.ProfileDownloadResult", 1418 UMA_HISTOGRAM_ENUMERATION("UserImage.ProfileDownloadResult",
1419 kDownloadSuccessChanged, 1419 kDownloadSuccessChanged,
1420 kDownloadResultsCount); 1420 kDownloadResultsCount);
1421 1421
1422 // This will persist |downloaded_profile_image_| to file. 1422 // This will persist |downloaded_profile_image_| to file.
1423 SaveUserImageFromProfileImage(GetLoggedInUser().email()); 1423 SaveUserImageFromProfileImage(GetLoggedInUser().email());
1424 } 1424 }
1425 } 1425 }
1426 1426
1427 if (result == kDownloadSuccess) { 1427 if (result == kDownloadSuccess) {
1428 // TODO(ivankr): temporary measure until UserManager is fully migrated
1429 // to use ImageSkia instead of SkBitmap.
1430 gfx::ImageSkia profile_image(downloaded_profile_image_);
1428 content::NotificationService::current()->Notify( 1431 content::NotificationService::current()->Notify(
1429 chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED, 1432 chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED,
1430 content::Source<UserManagerImpl>(this), 1433 content::Source<UserManagerImpl>(this),
1431 content::Details<const SkBitmap>(&downloaded_profile_image_)); 1434 content::Details<const gfx::ImageSkia>(&profile_image));
1432 } else { 1435 } else {
1433 content::NotificationService::current()->Notify( 1436 content::NotificationService::current()->Notify(
1434 chrome::NOTIFICATION_PROFILE_IMAGE_UPDATE_FAILED, 1437 chrome::NOTIFICATION_PROFILE_IMAGE_UPDATE_FAILED,
1435 content::Source<UserManagerImpl>(this), 1438 content::Source<UserManagerImpl>(this),
1436 content::NotificationService::NoDetails()); 1439 content::NotificationService::NoDetails());
1437 } 1440 }
1438 } 1441 }
1439 1442
1440 User* UserManagerImpl::CreateUser(const std::string& email) const { 1443 User* UserManagerImpl::CreateUser(const std::string& email) const {
1441 User* user = new User(email, email == kGuestUser); 1444 User* user = new User(email, email == kGuestUser);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 BrowserThread::PostTask( 1511 BrowserThread::PostTask(
1509 BrowserThread::FILE, 1512 BrowserThread::FILE,
1510 FROM_HERE, 1513 FROM_HERE,
1511 base::Bind(&UserManagerImpl::DeleteUserImage, 1514 base::Bind(&UserManagerImpl::DeleteUserImage,
1512 base::Unretained(this), 1515 base::Unretained(this),
1513 image_path)); 1516 image_path));
1514 } 1517 }
1515 } 1518 }
1516 1519
1517 } // namespace chromeos 1520 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698