Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/ui/views/avatar_menu_bubble_view.cc

Issue 19537006: Disable close-on-deactivate during tests so suprious UI events don't cause flakes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: renamed method to set_close_on_deactivate Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 layout->AddView(signout_button_); 465 layout->AddView(signout_button_);
466 layout->AddView(manage_button_); 466 layout->AddView(manage_button_);
467 SetLayoutManager(layout); 467 SetLayoutManager(layout);
468 } 468 }
469 469
470 470
471 // AvatarMenuBubbleView ------------------------------------------------------- 471 // AvatarMenuBubbleView -------------------------------------------------------
472 472
473 // static 473 // static
474 AvatarMenuBubbleView* AvatarMenuBubbleView::avatar_bubble_ = NULL; 474 AvatarMenuBubbleView* AvatarMenuBubbleView::avatar_bubble_ = NULL;
475 bool AvatarMenuBubbleView::close_on_deactivate_ = true;
475 476
476 // static 477 // static
477 void AvatarMenuBubbleView::ShowBubble( 478 void AvatarMenuBubbleView::ShowBubble(
478 views::View* anchor_view, 479 views::View* anchor_view,
479 views::BubbleBorder::Arrow arrow, 480 views::BubbleBorder::Arrow arrow,
480 views::BubbleBorder::BubbleAlignment border_alignment, 481 views::BubbleBorder::BubbleAlignment border_alignment,
481 const gfx::Rect& anchor_rect, 482 const gfx::Rect& anchor_rect,
482 Browser* browser) { 483 Browser* browser) {
483 if (IsShowing()) 484 if (IsShowing())
484 return; 485 return;
485 486
486 DCHECK(chrome::IsCommandEnabled(browser, IDC_SHOW_AVATAR_MENU)); 487 DCHECK(chrome::IsCommandEnabled(browser, IDC_SHOW_AVATAR_MENU));
487 avatar_bubble_ = new AvatarMenuBubbleView( 488 avatar_bubble_ = new AvatarMenuBubbleView(
488 anchor_view, arrow, anchor_rect, browser); 489 anchor_view, arrow, anchor_rect, browser);
489 views::BubbleDelegateView::CreateBubble(avatar_bubble_); 490 views::BubbleDelegateView::CreateBubble(avatar_bubble_);
491 avatar_bubble_->set_close_on_deactivate(close_on_deactivate_);
490 avatar_bubble_->SetBackgroundColors(); 492 avatar_bubble_->SetBackgroundColors();
491 avatar_bubble_->SetAlignment(border_alignment); 493 avatar_bubble_->SetAlignment(border_alignment);
492 avatar_bubble_->GetWidget()->Show(); 494 avatar_bubble_->GetWidget()->Show();
493 } 495 }
494 496
495 // static 497 // static
496 bool AvatarMenuBubbleView::IsShowing() { 498 bool AvatarMenuBubbleView::IsShowing() {
497 return avatar_bubble_ != NULL; 499 return avatar_bubble_ != NULL;
498 } 500 }
499 501
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 Layout(); 793 Layout();
792 if (GetBubbleFrameView()) 794 if (GetBubbleFrameView())
793 SizeToContents(); 795 SizeToContents();
794 } 796 }
795 797
796 void AvatarMenuBubbleView::SetBackgroundColors() { 798 void AvatarMenuBubbleView::SetBackgroundColors() {
797 for (size_t i = 0; i < item_views_.size(); ++i) { 799 for (size_t i = 0; i < item_views_.size(); ++i) {
798 item_views_[i]->OnHighlightStateChanged(); 800 item_views_[i]->OnHighlightStateChanged();
799 } 801 }
800 } 802 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698