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

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

Issue 8872015: [cros] Use a distinct icon for the guest session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 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 | « no previous file | chrome/browser/ui/views/frame/browser_view.h » ('j') | 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 20 matching lines...) Expand all
31 } 31 }
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_->IsGuestSession()) {
42 avatar_button_->SetAvatarIcon(
43 gfx::Image(new SkBitmap(browser_view_->GetGuestAvatarIcon())), false);
44 } else if (browser_view_->IsOffTheRecord()) {
42 avatar_button_->SetAvatarIcon( 45 avatar_button_->SetAvatarIcon(
43 gfx::Image(new SkBitmap(browser_view_->GetOTRAvatarIcon())), false); 46 gfx::Image(new SkBitmap(browser_view_->GetOTRAvatarIcon())), false);
44 } else { 47 } else {
45 ProfileInfoCache& cache = 48 ProfileInfoCache& cache =
46 g_browser_process->profile_manager()->GetProfileInfoCache(); 49 g_browser_process->profile_manager()->GetProfileInfoCache();
47 Profile* profile = browser_view_->browser()->profile(); 50 Profile* profile = browser_view_->browser()->profile();
48 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); 51 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath());
49 if (index != std::string::npos) { 52 if (index != std::string::npos) {
50 bool is_gaia_picture = 53 bool is_gaia_picture =
51 cache.IsUsingGAIAPictureOfProfileAtIndex(index) && 54 cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
52 cache.GetGAIAPictureOfProfileAtIndex(index); 55 cache.GetGAIAPictureOfProfileAtIndex(index);
53 avatar_button_->SetAvatarIcon( 56 avatar_button_->SetAvatarIcon(
54 cache.GetAvatarIconOfProfileAtIndex(index), is_gaia_picture); 57 cache.GetAvatarIconOfProfileAtIndex(index), is_gaia_picture);
55 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); 58 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index));
56 } 59 }
57 } 60 }
58 } 61 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698