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

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view.cc

Issue 8744010: Revert 112171 - Views: Custom drawing for GAIA avatar pictures (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/ui/views/avatar_menu_button.cc ('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) 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
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( 42 avatar_button_->SetIcon(browser_view_->GetOTRAvatarIcon());
43 gfx::Image(new SkBitmap(browser_view_->GetOTRAvatarIcon())), false);
44 } else { 43 } else {
45 ProfileInfoCache& cache = 44 ProfileInfoCache& cache =
46 g_browser_process->profile_manager()->GetProfileInfoCache(); 45 g_browser_process->profile_manager()->GetProfileInfoCache();
47 Profile* profile = browser_view_->browser()->profile(); 46 Profile* profile = browser_view_->browser()->profile();
48 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); 47 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
49 if (index != std::string::npos) { 48 if (index != std::string::npos) {
50 bool is_gaia_picture = 49 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index));
51 cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
52 cache.GetGAIAPictureOfProfileAtIndex(index);
53 avatar_button_->SetIcon(
54 cache.GetAvatarIconOfProfileAtIndex(index), is_gaia_picture);
55 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); 50 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index));
56 } 51 }
57 } 52 }
58 } 53 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698