OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 void AvatarMenuBubbleView::InitMenuContents( | 715 void AvatarMenuBubbleView::InitMenuContents( |
716 AvatarMenu* avatar_menu) { | 716 AvatarMenu* avatar_menu) { |
717 for (size_t i = 0; i < avatar_menu->GetNumberOfItems(); ++i) { | 717 for (size_t i = 0; i < avatar_menu->GetNumberOfItems(); ++i) { |
718 const AvatarMenu::Item& item = avatar_menu->GetItemAt(i); | 718 const AvatarMenu::Item& item = avatar_menu->GetItemAt(i); |
719 ProfileItemView* item_view = new ProfileItemView(item, | 719 ProfileItemView* item_view = new ProfileItemView(item, |
720 this, | 720 this, |
721 avatar_menu_.get()); | 721 avatar_menu_.get()); |
722 item_view->SetAccessibleName(l10n_util::GetStringFUTF16( | 722 item_view->SetAccessibleName(l10n_util::GetStringFUTF16( |
723 IDS_PROFILES_SWITCH_TO_PROFILE_ACCESSIBLE_NAME, item.name)); | 723 IDS_PROFILES_SWITCH_TO_PROFILE_ACCESSIBLE_NAME, item.name)); |
724 item_view->set_focusable(true); | 724 item_view->SetFocusable(true); |
725 AddChildView(item_view); | 725 AddChildView(item_view); |
726 item_views_.push_back(item_view); | 726 item_views_.push_back(item_view); |
727 } | 727 } |
728 | 728 |
729 if (CommandLine::ForCurrentProcess()->HasSwitch( | 729 if (CommandLine::ForCurrentProcess()->HasSwitch( |
730 switches::kNewProfileManagement)) { | 730 switches::kNewProfileManagement)) { |
731 separator_ = new views::Separator(views::Separator::HORIZONTAL); | 731 separator_ = new views::Separator(views::Separator::HORIZONTAL); |
732 AddChildView(separator_); | 732 AddChildView(separator_); |
733 buttons_view_ = new ActionButtonView(this, browser_->profile()); | 733 buttons_view_ = new ActionButtonView(this, browser_->profile()); |
734 AddChildView(buttons_view_); | 734 AddChildView(buttons_view_); |
(...skipping 70 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 |