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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Initializing the TabIconView is expensive, so only do it if we need to. | 196 // Initializing the TabIconView is expensive, so only do it if we need to. |
197 if (browser_view_->ShouldShowWindowIcon()) { | 197 if (browser_view_->ShouldShowWindowIcon()) { |
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()->profile()); | 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 AddChildView(avatar_button_.get()); | 209 AddChildView(avatar_button_.get()); |
210 UpdateAvatarInfo(); | 210 UpdateAvatarInfo(); |
211 if (!browser_view_->IsOffTheRecord()) { | 211 if (!browser_view_->IsOffTheRecord()) { |
212 registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED, | 212 registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED, |
213 NotificationService::AllSources()); | 213 NotificationService::AllSources()); |
214 } | 214 } |
215 } | 215 } |
216 } | 216 } |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1162 g_browser_process->profile_manager()->GetProfileInfoCache(); |
1163 Profile* profile = browser_view_->browser()->profile(); | 1163 Profile* profile = browser_view_->browser()->profile(); |
1164 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1164 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
1165 if (index != std::string::npos) { | 1165 if (index != std::string::npos) { |
1166 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1166 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
1167 avatar_button_->SetText(UTF16ToWideHack( | 1167 avatar_button_->SetText(UTF16ToWideHack( |
1168 cache.GetNameOfProfileAtIndex(index))); | 1168 cache.GetNameOfProfileAtIndex(index))); |
1169 } | 1169 } |
1170 } | 1170 } |
1171 } | 1171 } |
OLD | NEW |