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