1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/profiles/avatar_menu.h"
9 #include "chrome/browser/chromeos/login/user_manager.h"
10 #include "chrome/browser/chromeos/profiles/profile_helper.h"
11 #include "chrome/browser/profiles/profile_manager.h"
14 void AvatarMenu::GetImageForMenuButton(Profile
* profile
,
17 // Find the user for this profile.
18 std::string user_id_hash
=
19 chromeos::ProfileHelper::GetUserIdHashFromProfile(profile
);
20 chromeos::UserList users
= chromeos::UserManager::Get()->GetLoggedInUsers();
22 for (chromeos::UserList::const_iterator it
= users
.begin();
23 it
!= users
.end(); ++it
) {
24 if ((*it
)->username_hash() == user_id_hash
) {
25 *image
= gfx::Image((*it
)->image());
30 // ChromeOS user images are rectangular, unlike Chrome profile avatars.