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_info_cache.h" | 11 #include "chrome/browser/profiles/profile_info_cache.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/browser/profiles/profiles_state.h" | 13 #include "chrome/browser/profiles/profiles_state.h" |
13 #include "chrome/browser/ui/view_ids.h" | 14 #include "chrome/browser/ui/view_ids.h" |
14 #include "chrome/browser/ui/views/frame/browser_view.h" | 15 #include "chrome/browser/ui/views/frame/browser_view.h" |
15 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" | 16 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" |
16 #include "chrome/browser/ui/views/profiles/avatar_label.h" | 17 #include "chrome/browser/ui/views/profiles/avatar_label.h" |
17 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 18 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
18 #include "chrome/browser/ui/views/profiles/new_avatar_button.h" | 19 #include "chrome/browser/ui/views/profiles/new_avatar_button.h" |
19 #include "components/signin/core/common/profile_management_switches.h" | 20 #include "components/signin/core/common/profile_management_switches.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 avatar_button_ = NULL; | 85 avatar_button_ = NULL; |
85 frame_->GetRootView()->Layout(); | 86 frame_->GetRootView()->Layout(); |
86 } | 87 } |
87 | 88 |
88 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 89 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
89 gfx::Image avatar; | 90 gfx::Image avatar; |
90 gfx::Image taskbar_badge_avatar; | 91 gfx::Image taskbar_badge_avatar; |
91 base::string16 text; | 92 base::string16 text; |
92 bool is_rectangle = false; | 93 bool is_rectangle = false; |
93 if (browser_view_->IsGuestSession()) { | 94 if (browser_view_->IsGuestSession()) { |
94 avatar = rb.GetImageNamed(browser_view_->GetGuestIconResourceID()); | 95 avatar = rb. |
| 96 GetImageNamed(profiles::GetPlaceholderAvatarIconResourceID()); |
95 } else if (browser_view_->IsOffTheRecord()) { | 97 } else if (browser_view_->IsOffTheRecord()) { |
96 avatar = rb.GetImageNamed(browser_view_->GetOTRIconResourceID()); | 98 avatar = rb.GetImageNamed(browser_view_->GetOTRIconResourceID()); |
97 // TODO(nkostylev): Allow this on ChromeOS once the ChromeOS test | 99 // TODO(nkostylev): Allow this on ChromeOS once the ChromeOS test |
98 // environment handles profile directories correctly. | 100 // environment handles profile directories correctly. |
99 #if !defined(OS_CHROMEOS) | 101 #if !defined(OS_CHROMEOS) |
100 bool is_badge_rectangle = false; | 102 bool is_badge_rectangle = false; |
101 // 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. |
102 AvatarMenu::GetImageForMenuButton(browser_view_->browser()->profile(), | 104 AvatarMenu::GetImageForMenuButton(browser_view_->browser()->profile(), |
103 &taskbar_badge_avatar, | 105 &taskbar_badge_avatar, |
104 &is_badge_rectangle); | 106 &is_badge_rectangle); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); | 158 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); |
157 AddChildView(new_avatar_button_); | 159 AddChildView(new_avatar_button_); |
158 frame_->GetRootView()->Layout(); | 160 frame_->GetRootView()->Layout(); |
159 } | 161 } |
160 } else if (new_avatar_button_) { | 162 } else if (new_avatar_button_) { |
161 delete new_avatar_button_; | 163 delete new_avatar_button_; |
162 new_avatar_button_ = NULL; | 164 new_avatar_button_ = NULL; |
163 frame_->GetRootView()->Layout(); | 165 frame_->GetRootView()->Layout(); |
164 } | 166 } |
165 } | 167 } |
OLD | NEW |