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

Unified Diff: ui/views/bubble/tray_bubble_view.cc

Issue 1887273002: Revert of mash: Close system tray bubble on click outside its bounds, part 1 (patchset #4 id:60001 … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/bubble/tray_bubble_view.h ('k') | ui/views/mus/platform_window_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/tray_bubble_view.cc
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc
index 8bed90ea0c65cb32909610b71a6ccd36ce4d4a76..3d6e6485294bbdcba55c479b2fb4fb49161559cb 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -281,14 +281,14 @@ TrayBubbleView::InitParams::InitParams(AnchorType anchor_type,
max_height(0),
can_activate(false),
close_on_deactivate(true),
- close_via_capture(false),
arrow_color(SK_ColorBLACK),
first_item_has_no_margin(false),
arrow(BubbleBorder::NONE),
arrow_offset(kArrowDefaultOffset),
arrow_paint_type(BubbleBorder::PAINT_NORMAL),
shadow(BubbleBorder::BIG_SHADOW),
- arrow_alignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE) {}
+ arrow_alignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE) {
+}
TrayBubbleView::InitParams::InitParams(const InitParams& other) = default;
@@ -356,12 +356,6 @@ void TrayBubbleView::InitializeAndShowBubble() {
GetWidget()->GetNativeWindow()->SetEventTargeter(
std::unique_ptr<ui::EventTargeter>(new BubbleWindowTargeter(this)));
UpdateBubble();
-
- if (params_.close_via_capture) {
- GetWidget()->set_auto_release_capture(false);
- // Capture events to this view so it will be notified of capture loss.
- GetWidget()->SetCapture(this);
- }
}
void TrayBubbleView::UpdateBubble() {
@@ -454,13 +448,6 @@ int TrayBubbleView::GetHeightForWidth(int width) const {
std::min(height, params_.max_height) : height;
}
-void TrayBubbleView::OnMouseCaptureLost() {
- if (params_.close_via_capture && delegate_) {
- // Let the delegate destroy the bubble in case it needs to do cleanup.
- delegate_->HideBubble(this);
- }
-}
-
void TrayBubbleView::OnMouseEntered(const ui::MouseEvent& event) {
mouse_watcher_.reset();
if (delegate_ && !(event.flags() & ui::EF_IS_SYNTHESIZED)) {
@@ -495,17 +482,6 @@ void TrayBubbleView::OnMouseExited(const ui::MouseEvent& event) {
delegate_->OnMouseExitedView();
}
-bool TrayBubbleView::OnMousePressed(const ui::MouseEvent& event) {
- if (params_.close_via_capture && GetWidget()->HasCapture() &&
- !bounds().Contains(event.location())) {
- // Explicitly releasing capture will close the bubble.
- GetWidget()->ReleaseCapture();
- // Don't return that the event was handled because other views may want to
- // handle it or the window server may want to repost it.
- }
- return views::BubbleDelegateView::OnMousePressed(event);
-}
-
void TrayBubbleView::GetAccessibleState(ui::AXViewState* state) {
if (delegate_ && params_.can_activate) {
state->role = ui::AX_ROLE_WINDOW;
« no previous file with comments | « ui/views/bubble/tray_bubble_view.h ('k') | ui/views/mus/platform_window_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698