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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 window_icon_ = new TabIconView(this); | 198 window_icon_ = new TabIconView(this); |
199 window_icon_->set_is_light(true); | 199 window_icon_->set_is_light(true); |
200 AddChildView(window_icon_); | 200 AddChildView(window_icon_); |
201 window_icon_->Update(); | 201 window_icon_->Update(); |
202 } | 202 } |
203 | 203 |
204 if (browser_view_->ShouldShowAvatar()) { | 204 if (browser_view_->ShouldShowAvatar()) { |
205 ui::MenuModel* menu_model = browser_view_->IsOffTheRecord() ? | 205 ui::MenuModel* menu_model = browser_view_->IsOffTheRecord() ? |
206 NULL : new ProfileMenuModel(browser_view_->browser()); | 206 NULL : new ProfileMenuModel(browser_view_->browser()); |
207 // AvatarMenuButton takes ownership of |menu_model|. | 207 // AvatarMenuButton takes ownership of |menu_model|. |
208 avatar_button_.reset(new AvatarMenuButton(std::wstring(), menu_model)); | 208 avatar_button_.reset(new AvatarMenuButton(std::wstring(), menu_model, |
| 209 browser_view_->browser())); |
209 AddChildView(avatar_button_.get()); | 210 AddChildView(avatar_button_.get()); |
210 UpdateAvatarInfo(); | 211 UpdateAvatarInfo(); |
211 if (!browser_view_->IsOffTheRecord()) { | 212 if (!browser_view_->IsOffTheRecord()) { |
212 registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED, | 213 registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED, |
213 NotificationService::AllSources()); | 214 NotificationService::AllSources()); |
214 } | 215 } |
215 } | 216 } |
216 } | 217 } |
217 | 218 |
218 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { | 219 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1163 g_browser_process->profile_manager()->GetProfileInfoCache(); |
1163 Profile* profile = browser_view_->browser()->profile(); | 1164 Profile* profile = browser_view_->browser()->profile(); |
1164 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1165 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
1165 if (index != std::string::npos) { | 1166 if (index != std::string::npos) { |
1166 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1167 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
1167 avatar_button_->SetText(UTF16ToWideHack( | 1168 avatar_button_->SetText(UTF16ToWideHack( |
1168 cache.GetNameOfProfileAtIndex(index))); | 1169 cache.GetNameOfProfileAtIndex(index))); |
1169 } | 1170 } |
1170 } | 1171 } |
1171 } | 1172 } |
OLD | NEW |