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/profiles/avatar_menu.h" | 8 #include "chrome/browser/profiles/avatar_menu.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 10 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 89 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
90 gfx::Image avatar; | 90 gfx::Image avatar; |
91 gfx::Image taskbar_badge_avatar; | 91 gfx::Image taskbar_badge_avatar; |
92 base::string16 text; | 92 base::string16 text; |
93 bool is_rectangle = false; | 93 bool is_rectangle = false; |
94 if (browser_view_->IsGuestSession()) { | 94 if (browser_view_->IsGuestSession()) { |
95 avatar = rb. | 95 avatar = rb. |
96 GetImageNamed(profiles::GetPlaceholderAvatarIconResourceID()); | 96 GetImageNamed(profiles::GetPlaceholderAvatarIconResourceID()); |
97 } else if (browser_view_->IsOffTheRecord()) { | 97 } else if (browser_view_->IsOffTheRecord()) { |
98 avatar = rb.GetImageNamed(browser_view_->GetOTRIconResourceID()); | 98 avatar = rb.GetImageNamed(IDR_OTR_ICON); |
99 // TODO(nkostylev): Allow this on ChromeOS once the ChromeOS test | 99 // TODO(nkostylev): Allow this on ChromeOS once the ChromeOS test |
100 // environment handles profile directories correctly. | 100 // environment handles profile directories correctly. |
101 #if !defined(OS_CHROMEOS) | 101 #if !defined(OS_CHROMEOS) |
102 bool is_badge_rectangle = false; | 102 bool is_badge_rectangle = false; |
103 // The taskbar badge should be the profile avatar, not the OTR avatar. | 103 // The taskbar badge should be the profile avatar, not the OTR avatar. |
104 AvatarMenu::GetImageForMenuButton(browser_view_->browser()->profile(), | 104 AvatarMenu::GetImageForMenuButton(browser_view_->browser()->profile(), |
105 &taskbar_badge_avatar, | 105 &taskbar_badge_avatar, |
106 &is_badge_rectangle); | 106 &is_badge_rectangle); |
107 #endif | 107 #endif |
108 } else if (avatar_button_ || AvatarMenu::ShouldShowAvatarMenu()) { | 108 } else if (avatar_button_ || AvatarMenu::ShouldShowAvatarMenu()) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); | 158 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); |
159 AddChildView(new_avatar_button_); | 159 AddChildView(new_avatar_button_); |
160 frame_->GetRootView()->Layout(); | 160 frame_->GetRootView()->Layout(); |
161 } | 161 } |
162 } else if (new_avatar_button_) { | 162 } else if (new_avatar_button_) { |
163 delete new_avatar_button_; | 163 delete new_avatar_button_; |
164 new_avatar_button_ = NULL; | 164 new_avatar_button_ = NULL; |
165 frame_->GetRootView()->Layout(); | 165 frame_->GetRootView()->Layout(); |
166 } | 166 } |
167 } | 167 } |
OLD | NEW |