Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 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); |
|
whywhat
2011/12/08 17:21:01
Maybe we should rather change GetOTRAvatarIcon tha
Ivan Korotkov
2011/12/09 09:38:22
As discussed offline, better leave it as is.
| |
| 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 } |
| OLD | NEW |