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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 1136693002: Chrome user menu shouldn't close if a tab steals focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chrome user menu shouldn't close if a tab steals focus Created 5 years, 7 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 gfx::Rect bounds(origin, anchor_view->size()); 2501 gfx::Rect bounds(origin, anchor_view->size());
2502 views::BubbleBorder::ArrowPaintType arrow_paint_type = 2502 views::BubbleBorder::ArrowPaintType arrow_paint_type =
2503 ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT : 2503 ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT :
2504 views::BubbleBorder::PAINT_NORMAL; 2504 views::BubbleBorder::PAINT_NORMAL;
2505 AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type, 2505 AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type,
2506 alignment, bounds, browser()); 2506 alignment, bounds, browser());
2507 } 2507 }
2508 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); 2508 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
2509 } 2509 }
2510 2510
2511 void BrowserView::CloseAvatarBubbleFromAvatarButton() {
2512 if (switches::IsNewAvatarMenu()) {
Roger Tawa OOO till Jul 10th 2015/05/14 18:55:03 The check for switches::IsNewAvatarMenu() is missi
gogerald1 2015/05/14 21:35:22 Can't, since both menus in cocoa code have common
2513 if (ProfileChooserView::IsShowing())
2514 ProfileChooserView::Hide();
2515 } else {
2516 if (AvatarMenuBubbleView::IsShowing())
2517 AvatarMenuBubbleView::Hide();
2518 }
Roger Tawa OOO till Jul 10th 2015/05/14 18:55:02 You don't need the calls to IsShowing() in both ca
gogerald1 2015/05/14 21:35:22 Done.
2519 }
2520
2511 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { 2521 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() {
2512 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || 2522 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED ||
2513 !bookmark_bar_view_.get() || !bookmark_bar_view_->IsDetached()) { 2523 !bookmark_bar_view_.get() || !bookmark_bar_view_->IsDetached()) {
2514 return 0; 2524 return 0;
2515 } 2525 }
2516 // Don't use bookmark_bar_view_->height() which won't be the final height if 2526 // Don't use bookmark_bar_view_->height() which won't be the final height if
2517 // the bookmark bar is animating. 2527 // the bookmark bar is animating.
2518 return chrome::kNTPBookmarkBarHeight - 2528 return chrome::kNTPBookmarkBarHeight -
2519 bookmark_bar_view_->GetFullyDetachedToolbarOverlap(); 2529 bookmark_bar_view_->GetFullyDetachedToolbarOverlap();
2520 } 2530 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 return immersive_mode_controller()->IsEnabled(); 2616 return immersive_mode_controller()->IsEnabled();
2607 } 2617 }
2608 2618
2609 views::Widget* BrowserView::GetBubbleAssociatedWidget() { 2619 views::Widget* BrowserView::GetBubbleAssociatedWidget() {
2610 return GetWidget(); 2620 return GetWidget();
2611 } 2621 }
2612 2622
2613 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { 2623 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() {
2614 return top_container_->GetBoundsInScreen(); 2624 return top_container_->GetBoundsInScreen();
2615 } 2625 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698