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/glass_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 : BrowserNonClientFrameView(), | 80 : BrowserNonClientFrameView(), |
81 frame_(frame), | 81 frame_(frame), |
82 browser_view_(browser_view), | 82 browser_view_(browser_view), |
83 throbber_running_(false), | 83 throbber_running_(false), |
84 throbber_frame_(0) { | 84 throbber_frame_(0) { |
85 if (browser_view_->ShouldShowWindowIcon()) | 85 if (browser_view_->ShouldShowWindowIcon()) |
86 InitThrobberIcons(); | 86 InitThrobberIcons(); |
87 | 87 |
88 if (browser_view_->ShouldShowAvatar()) { | 88 if (browser_view_->ShouldShowAvatar()) { |
89 ui::MenuModel* menu_model = browser_view_->IsOffTheRecord() ? | 89 ui::MenuModel* menu_model = browser_view_->IsOffTheRecord() ? |
90 NULL : new ProfileMenuModel(browser_view_->browser()->profile()); | 90 NULL : new ProfileMenuModel(browser_view_->browser()); |
91 // AvatarMenuButton takes ownership of |menu_model|. | 91 // AvatarMenuButton takes ownership of |menu_model|. |
92 avatar_button_.reset(new AvatarMenuButton(std::wstring(), menu_model)); | 92 avatar_button_.reset(new AvatarMenuButton(std::wstring(), menu_model)); |
93 AddChildView(avatar_button_.get()); | 93 AddChildView(avatar_button_.get()); |
94 UpdateAvatarInfo(); | 94 UpdateAvatarInfo(); |
95 if (!browser_view_->IsOffTheRecord()) { | 95 if (!browser_view_->IsOffTheRecord()) { |
96 registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED, | 96 registrar_.Add(this, NotificationType::PROFILE_CACHED_INFO_CHANGED, |
97 NotificationService::AllSources()); | 97 NotificationService::AllSources()); |
98 } | 98 } |
99 } | 99 } |
100 } | 100 } |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 ProfileInfoCache& cache = | 550 ProfileInfoCache& cache = |
551 g_browser_process->profile_manager()->GetProfileInfoCache(); | 551 g_browser_process->profile_manager()->GetProfileInfoCache(); |
552 Profile* profile = browser_view_->browser()->profile(); | 552 Profile* profile = browser_view_->browser()->profile(); |
553 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 553 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
554 if (index != std::string::npos) { | 554 if (index != std::string::npos) { |
555 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 555 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
556 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); | 556 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); |
557 } | 557 } |
558 } | 558 } |
559 } | 559 } |
OLD | NEW |