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

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

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: iOS, Windows, and CrOS compile fixes Created 3 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/users/avatar/user_image_manager_impl.h" 5 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 job_->LoadImage(base::FilePath(image_path), image_index, image_url); 641 job_->LoadImage(base::FilePath(image_path), image_index, image_url);
642 } 642 }
643 643
644 void UserImageManagerImpl::UserLoggedIn(bool user_is_new, 644 void UserImageManagerImpl::UserLoggedIn(bool user_is_new,
645 bool user_is_local) { 645 bool user_is_local) {
646 const user_manager::User* user = GetUser(); 646 const user_manager::User* user = GetUser();
647 if (user_is_new) { 647 if (user_is_new) {
648 if (!user_is_local) 648 if (!user_is_local)
649 SetInitialUserImage(); 649 SetInitialUserImage();
650 } else { 650 } else {
651 UMA_HISTOGRAM_ENUMERATION("UserImage.LoggedIn", 651 UMA_HISTOGRAM_EXACT_LINEAR("UserImage.LoggedIn",
wychen 2017/03/27 20:08:56 Ditto.
652 ImageIndexToHistogramIndex(user->image_index()), 652 ImageIndexToHistogramIndex(user->image_index()),
653 default_user_image::kHistogramImagesCount); 653 default_user_image::kHistogramImagesCount);
654 } 654 }
655 655
656 // Reset the downloaded profile image as a new user logged in. 656 // Reset the downloaded profile image as a new user logged in.
657 downloaded_profile_image_ = gfx::ImageSkia(); 657 downloaded_profile_image_ = gfx::ImageSkia();
658 profile_image_url_ = GURL(); 658 profile_image_url_ = GURL();
659 profile_image_requested_ = false; 659 profile_image_requested_ = false;
660 660
661 user_image_sync_observer_.reset(); 661 user_image_sync_observer_.reset();
662 TryToCreateImageSyncObserver(); 662 TryToCreateImageSyncObserver();
663 } 663 }
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 } 1022 }
1023 1023
1024 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const { 1024 bool UserImageManagerImpl::IsUserLoggedInAndHasGaiaAccount() const {
1025 const user_manager::User* user = GetUser(); 1025 const user_manager::User* user = GetUser();
1026 if (!user) 1026 if (!user)
1027 return false; 1027 return false;
1028 return user->is_logged_in() && user->HasGaiaAccount(); 1028 return user->is_logged_in() && user->HasGaiaAccount();
1029 } 1029 }
1030 1030
1031 } // namespace chromeos 1031 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698