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/avatar_menu_bubble_view.h" | 5 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/profiles/avatar_menu_model.h" | 10 #include "chrome/browser/profiles/avatar_menu_model.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 private: | 128 private: |
129 size_t profile_index_; | 129 size_t profile_index_; |
130 }; | 130 }; |
131 | 131 |
132 AvatarMenuBubbleView::AvatarMenuBubbleView(Browser* browser) | 132 AvatarMenuBubbleView::AvatarMenuBubbleView(Browser* browser) |
133 : add_profile_link_(NULL), | 133 : add_profile_link_(NULL), |
134 browser_(browser), | 134 browser_(browser), |
135 edit_profile_button_(NULL) { | 135 edit_profile_button_(NULL) { |
136 avatar_menu_model_.reset(new AvatarMenuModel( | 136 avatar_menu_model_.reset(new AvatarMenuModel( |
137 &g_browser_process->profile_manager()->GetProfileInfo(), | 137 &g_browser_process->profile_manager()->GetProfileInfoCache(), |
138 this, browser_)); | 138 this, browser_)); |
139 // Build the menu for the first time. | 139 // Build the menu for the first time. |
140 OnAvatarMenuModelChanged(avatar_menu_model_.get()); | 140 OnAvatarMenuModelChanged(avatar_menu_model_.get()); |
141 } | 141 } |
142 | 142 |
143 AvatarMenuBubbleView::~AvatarMenuBubbleView() { | 143 AvatarMenuBubbleView::~AvatarMenuBubbleView() { |
144 } | 144 } |
145 | 145 |
146 gfx::Size AvatarMenuBubbleView::GetPreferredSize() { | 146 gfx::Size AvatarMenuBubbleView::GetPreferredSize() { |
147 int max_width = 0; | 147 int max_width = 0; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 257 } |
258 | 258 |
259 add_profile_link_ = new views::Link(UTF16ToWide( | 259 add_profile_link_ = new views::Link(UTF16ToWide( |
260 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK))); | 260 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK))); |
261 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 261 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
262 add_profile_link_->SetNormalColor(SkColorSetRGB(0, 0x79, 0xda)); | 262 add_profile_link_->SetNormalColor(SkColorSetRGB(0, 0x79, 0xda)); |
263 AddChildView(add_profile_link_); | 263 AddChildView(add_profile_link_); |
264 | 264 |
265 PreferredSizeChanged(); | 265 PreferredSizeChanged(); |
266 } | 266 } |
OLD | NEW |