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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 AddChildView(item_view); | 750 AddChildView(item_view); |
751 separator_ = new views::Separator(views::Separator::HORIZONTAL); | 751 separator_ = new views::Separator(views::Separator::HORIZONTAL); |
752 AddChildView(separator_); | 752 AddChildView(separator_); |
753 | 753 |
754 // Add information about supervised users. | 754 // Add information about supervised users. |
755 supervised_user_info_ = | 755 supervised_user_info_ = |
756 new views::Label(avatar_menu_->GetSupervisedUserInformation(), | 756 new views::Label(avatar_menu_->GetSupervisedUserInformation(), |
757 ui::ResourceBundle::GetSharedInstance().GetFontList( | 757 ui::ResourceBundle::GetSharedInstance().GetFontList( |
758 ui::ResourceBundle::SmallFont)); | 758 ui::ResourceBundle::SmallFont)); |
759 supervised_user_info_->SetMultiLine(true); | 759 supervised_user_info_->SetMultiLine(true); |
| 760 supervised_user_info_->SetAllowCharacterBreak(true); |
760 supervised_user_info_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 761 supervised_user_info_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
761 supervised_user_info_->SetBackgroundColor(color()); | 762 supervised_user_info_->SetBackgroundColor(color()); |
762 AddChildView(supervised_user_info_); | 763 AddChildView(supervised_user_info_); |
763 | 764 |
764 // Add the supervised user icon. | 765 // Add the supervised user icon. |
765 icon_view_ = new views::ImageView(); | 766 icon_view_ = new views::ImageView(); |
766 icon_view_->SetImage(avatar_menu_->GetSupervisedUserIcon().ToImageSkia()); | 767 icon_view_->SetImage(avatar_menu_->GetSupervisedUserIcon().ToImageSkia()); |
767 AddChildView(icon_view_); | 768 AddChildView(icon_view_); |
768 | 769 |
769 // Add a link for switching profiles. | 770 // Add a link for switching profiles. |
(...skipping 25 matching lines...) Expand all Loading... |
795 Layout(); | 796 Layout(); |
796 if (GetBubbleFrameView()) | 797 if (GetBubbleFrameView()) |
797 SizeToContents(); | 798 SizeToContents(); |
798 } | 799 } |
799 | 800 |
800 void AvatarMenuBubbleView::SetBackgroundColors() { | 801 void AvatarMenuBubbleView::SetBackgroundColors() { |
801 for (size_t i = 0; i < item_views_.size(); ++i) { | 802 for (size_t i = 0; i < item_views_.size(); ++i) { |
802 item_views_[i]->OnHighlightStateChanged(); | 803 item_views_[i]->OnHighlightStateChanged(); |
803 } | 804 } |
804 } | 805 } |
OLD | NEW |