Roll WebRTC 5699->5721.
[chromium-blink-merge.git] / chrome / browser / profiles / avatar_menu_desktop.cc
blob35949a5ef7ec71e3733745a0633c68251d9654ab
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"
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_info_cache.h"
10 #include "chrome/browser/profiles/profile_manager.h"
12 // static
13 void AvatarMenu::GetImageForMenuButton(Profile* profile,
14 gfx::Image* image,
15 bool* is_rectangle) {
16 ProfileInfoCache& cache =
17 g_browser_process->profile_manager()->GetProfileInfoCache();
18 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
19 if (index == std::string::npos) {
20 NOTREACHED();
21 return;
24 *image = cache.GetAvatarIconOfProfileAtIndex(index);
25 *is_rectangle =
26 cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
27 cache.GetGAIAPictureOfProfileAtIndex(index);