OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/managed_mode.h" | 8 #include "chrome/browser/managed_mode.h" |
9 #include "chrome/browser/profiles/avatar_menu_model.h" | 9 #include "chrome/browser/profiles/avatar_menu_model.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 gfx::Image avatar; | 45 gfx::Image avatar; |
46 string16 text; | 46 string16 text; |
47 bool is_gaia_picture = false; | 47 bool is_gaia_picture = false; |
48 if (browser_view_->IsGuestSession()) { | 48 if (browser_view_->IsGuestSession()) { |
49 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
50 avatar = rb.GetImageNamed(IDR_GUEST_ICON); | 50 avatar = rb.GetImageNamed(IDR_GUEST_ICON); |
51 #else | 51 #else |
52 NOTREACHED(); | 52 NOTREACHED(); |
53 #endif | 53 #endif |
54 } else if (browser_view_->IsOffTheRecord()) { | 54 } else if (browser_view_->IsOffTheRecord()) { |
55 avatar = rb.GetImageNamed(browser_view_->GetOTRIconResourceID()); | 55 avatar = rb.GetImageNamed(IDR_OTR_ICON); |
56 } else if (ManagedMode::IsInManagedMode()) { | 56 } else if (ManagedMode::IsInManagedMode()) { |
57 avatar = rb.GetImageNamed(IDR_MANAGED_MODE_AVATAR); | 57 avatar = rb.GetImageNamed(IDR_MANAGED_MODE_AVATAR); |
58 } else if (AvatarMenuModel::ShouldShowAvatarMenu()) { | 58 } else if (AvatarMenuModel::ShouldShowAvatarMenu()) { |
59 ProfileInfoCache& cache = | 59 ProfileInfoCache& cache = |
60 g_browser_process->profile_manager()->GetProfileInfoCache(); | 60 g_browser_process->profile_manager()->GetProfileInfoCache(); |
61 Profile* profile = browser_view_->browser()->profile(); | 61 Profile* profile = browser_view_->browser()->profile(); |
62 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 62 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
63 if (index == std::string::npos) | 63 if (index == std::string::npos) |
64 return; | 64 return; |
65 is_gaia_picture = | 65 is_gaia_picture = |
(...skipping 20 matching lines...) Expand all Loading... |
86 | 86 |
87 void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from, | 87 void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from, |
88 bool is_visible) { | 88 bool is_visible) { |
89 if (!is_visible) | 89 if (!is_visible) |
90 return; | 90 return; |
91 // The first time UpdateAvatarInfo() is called the window is not visible so | 91 // The first time UpdateAvatarInfo() is called the window is not visible so |
92 // DrawTaskBarDecoration() has no effect. Therefore we need to call it again | 92 // DrawTaskBarDecoration() has no effect. Therefore we need to call it again |
93 // once the window is visible. | 93 // once the window is visible. |
94 UpdateAvatarInfo(); | 94 UpdateAvatarInfo(); |
95 } | 95 } |
OLD | NEW |