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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 450 |
451 for (size_t i = 0; i < item_views_.size(); ++i) { | 451 for (size_t i = 0; i < item_views_.size(); ++i) { |
452 ProfileItemView* item_view = static_cast<ProfileItemView*>(item_views_[i]); | 452 ProfileItemView* item_view = static_cast<ProfileItemView*>(item_views_[i]); |
453 if (source == item_view->edit_link()) { | 453 if (source == item_view->edit_link()) { |
454 avatar_menu_model_->EditProfile(i); | 454 avatar_menu_model_->EditProfile(i); |
455 return; | 455 return; |
456 } | 456 } |
457 } | 457 } |
458 } | 458 } |
459 | 459 |
460 gfx::Point AvatarMenuBubbleView::GetAnchorPoint() { | 460 gfx::Rect AvatarMenuBubbleView::GetAnchorRect() { |
461 return gfx::Point(anchor_rect_.CenterPoint().x(), anchor_rect_.bottom()); | 461 return anchor_rect_; |
462 } | 462 } |
463 | 463 |
464 void AvatarMenuBubbleView::Init() { | 464 void AvatarMenuBubbleView::Init() { |
465 AddAccelerator(ui::Accelerator(ui::VKEY_DOWN, 0)); | 465 AddAccelerator(ui::Accelerator(ui::VKEY_DOWN, 0)); |
466 AddAccelerator(ui::Accelerator(ui::VKEY_UP, 0)); | 466 AddAccelerator(ui::Accelerator(ui::VKEY_UP, 0)); |
467 } | 467 } |
468 | 468 |
469 void AvatarMenuBubbleView::OnAvatarMenuModelChanged( | 469 void AvatarMenuBubbleView::OnAvatarMenuModelChanged( |
470 AvatarMenuModel* avatar_menu_model) { | 470 AvatarMenuModel* avatar_menu_model) { |
471 // Unset all our child view references and call RemoveAllChildViews() which | 471 // Unset all our child view references and call RemoveAllChildViews() which |
(...skipping 17 matching lines...) Expand all Loading... |
489 | 489 |
490 add_profile_link_ = new views::Link( | 490 add_profile_link_ = new views::Link( |
491 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)); | 491 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)); |
492 add_profile_link_->set_listener(this); | 492 add_profile_link_->set_listener(this); |
493 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 493 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
494 add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); | 494 add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); |
495 AddChildView(add_profile_link_); | 495 AddChildView(add_profile_link_); |
496 | 496 |
497 PreferredSizeChanged(); | 497 PreferredSizeChanged(); |
498 } | 498 } |
OLD | NEW |