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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 // static | 484 // static |
485 void AvatarMenuBubbleView::ShowBubble( | 485 void AvatarMenuBubbleView::ShowBubble( |
486 views::View* anchor_view, | 486 views::View* anchor_view, |
487 views::BubbleBorder::Arrow arrow, | 487 views::BubbleBorder::Arrow arrow, |
488 views::BubbleBorder::BubbleAlignment border_alignment, | 488 views::BubbleBorder::BubbleAlignment border_alignment, |
489 const gfx::Rect& anchor_rect, | 489 const gfx::Rect& anchor_rect, |
490 Browser* browser) { | 490 Browser* browser) { |
491 if (IsShowing()) | 491 if (IsShowing()) |
492 return; | 492 return; |
493 | 493 |
494 DCHECK(chrome::IsCommandEnabled(browser, IDC_SHOW_AVATAR_MENU)); | |
Peter Kasting
2014/05/07 20:58:44
So it actually makes sense to show the menu in the
msw
2014/05/07 21:31:07
When enabling the command also enables the Ctrl+Sh
Peter Kasting
2014/05/07 21:33:36
Consider:
F11, ctrl-D
This bookmarks the current
msw
2014/05/07 21:47:43
That's reasonable, but is it worth adding this fun
Peter Kasting
2014/05/07 21:50:05
Are we really adding functionality? I thought all
msw
2014/05/07 23:19:18
The latest patch set adds support for the command
| |
495 avatar_bubble_ = new AvatarMenuBubbleView( | 494 avatar_bubble_ = new AvatarMenuBubbleView( |
496 anchor_view, arrow, anchor_rect, browser); | 495 anchor_view, arrow, anchor_rect, browser); |
497 views::BubbleDelegateView::CreateBubble(avatar_bubble_); | 496 views::BubbleDelegateView::CreateBubble(avatar_bubble_); |
498 avatar_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); | 497 avatar_bubble_->set_close_on_deactivate(close_on_deactivate_for_testing_); |
499 avatar_bubble_->SetBackgroundColors(); | 498 avatar_bubble_->SetBackgroundColors(); |
500 avatar_bubble_->SetAlignment(border_alignment); | 499 avatar_bubble_->SetAlignment(border_alignment); |
501 avatar_bubble_->GetWidget()->Show(); | 500 avatar_bubble_->GetWidget()->Show(); |
502 } | 501 } |
503 | 502 |
504 // static | 503 // static |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
801 Layout(); | 800 Layout(); |
802 if (GetBubbleFrameView()) | 801 if (GetBubbleFrameView()) |
803 SizeToContents(); | 802 SizeToContents(); |
804 } | 803 } |
805 | 804 |
806 void AvatarMenuBubbleView::SetBackgroundColors() { | 805 void AvatarMenuBubbleView::SetBackgroundColors() { |
807 for (size_t i = 0; i < item_views_.size(); ++i) { | 806 for (size_t i = 0; i < item_views_.size(); ++i) { |
808 item_views_[i]->OnHighlightStateChanged(); | 807 item_views_[i]->OnHighlightStateChanged(); |
809 } | 808 } |
810 } | 809 } |
OLD | NEW |