OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/frame/browser_non_client_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_info_cache.h" | 9 #include "chrome/browser/profiles/profile_info_cache.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } else if (avatar_button_.get()) { | 32 } else if (avatar_button_.get()) { |
33 RemoveChildView(avatar_button_.get()); | 33 RemoveChildView(avatar_button_.get()); |
34 avatar_button_.reset(); | 34 avatar_button_.reset(); |
35 frame_->GetRootView()->Layout(); | 35 frame_->GetRootView()->Layout(); |
36 } | 36 } |
37 | 37 |
38 if (!avatar_button_.get()) | 38 if (!avatar_button_.get()) |
39 return; | 39 return; |
40 | 40 |
41 if (browser_view_->IsOffTheRecord()) { | 41 if (browser_view_->IsOffTheRecord()) { |
42 avatar_button_->SetIcon(browser_view_->GetOTRAvatarIcon()); | 42 avatar_button_->SetIcon( |
| 43 gfx::Image(new SkBitmap(browser_view_->GetOTRAvatarIcon())), false); |
43 } else { | 44 } else { |
44 ProfileInfoCache& cache = | 45 ProfileInfoCache& cache = |
45 g_browser_process->profile_manager()->GetProfileInfoCache(); | 46 g_browser_process->profile_manager()->GetProfileInfoCache(); |
46 Profile* profile = browser_view_->browser()->profile(); | 47 Profile* profile = browser_view_->browser()->profile(); |
47 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 48 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
48 if (index != std::string::npos) { | 49 if (index != std::string::npos) { |
49 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 50 bool is_gaia_picture = |
| 51 cache.IsUsingGAIAPictureOfProfileAtIndex(index) && |
| 52 cache.GetGAIAPictureOfProfileAtIndex(index); |
| 53 avatar_button_->SetIcon( |
| 54 cache.GetAvatarIconOfProfileAtIndex(index), is_gaia_picture); |
50 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); | 55 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); |
51 } | 56 } |
52 } | 57 } |
53 } | 58 } |
OLD | NEW |