OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/avatar_menu_bubble_view.h" | 5 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 name_label_ = new views::Label(item_.name, | 275 name_label_ = new views::Label(item_.name, |
276 rb->GetFontList(item_.active ? | 276 rb->GetFontList(item_.active ? |
277 ui::ResourceBundle::BoldFont : | 277 ui::ResourceBundle::BoldFont : |
278 ui::ResourceBundle::BaseFont)); | 278 ui::ResourceBundle::BaseFont)); |
279 name_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 279 name_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
280 AddChildView(name_label_); | 280 AddChildView(name_label_); |
281 | 281 |
282 // Add a label to show the sync state. | 282 // Add a label to show the sync state. |
283 sync_state_label_ = new views::Label(item_.sync_state); | 283 sync_state_label_ = new views::Label(item_.sync_state); |
284 if (item_.signed_in) | 284 if (item_.signed_in) |
285 sync_state_label_->SetElideBehavior(views::Label::ELIDE_AS_EMAIL); | 285 sync_state_label_->SetElideBehavior(gfx::ELIDE_EMAIL); |
286 sync_state_label_->SetFontList( | 286 sync_state_label_->SetFontList( |
287 rb->GetFontList(ui::ResourceBundle::SmallFont)); | 287 rb->GetFontList(ui::ResourceBundle::SmallFont)); |
288 sync_state_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 288 sync_state_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
289 sync_state_label_->SetEnabled(false); | 289 sync_state_label_->SetEnabled(false); |
290 AddChildView(sync_state_label_); | 290 AddChildView(sync_state_label_); |
291 | 291 |
292 // Add an edit profile link. | 292 // Add an edit profile link. |
293 edit_link_ = new EditProfileLink( | 293 edit_link_ = new EditProfileLink( |
294 l10n_util::GetStringUTF16(IDS_PROFILES_EDIT_PROFILE_LINK), this); | 294 l10n_util::GetStringUTF16(IDS_PROFILES_EDIT_PROFILE_LINK), this); |
295 edit_link_->set_listener(parent); | 295 edit_link_->set_listener(parent); |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 Layout(); | 805 Layout(); |
806 if (GetBubbleFrameView()) | 806 if (GetBubbleFrameView()) |
807 SizeToContents(); | 807 SizeToContents(); |
808 } | 808 } |
809 | 809 |
810 void AvatarMenuBubbleView::SetBackgroundColors() { | 810 void AvatarMenuBubbleView::SetBackgroundColors() { |
811 for (size_t i = 0; i < item_views_.size(); ++i) { | 811 for (size_t i = 0; i < item_views_.size(); ++i) { |
812 item_views_[i]->OnHighlightStateChanged(); | 812 item_views_[i]->OnHighlightStateChanged(); |
813 } | 813 } |
814 } | 814 } |
OLD | NEW |