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

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

Issue 1887263002: Revert of mash: Close system tray bubble on click outside its bounds, part 1 (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 6c276349b91b6a4ab3611e318f7c21e4320d24d8..ad3267fe6592c034a1dffd9794ae11e4449b1bb4 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -281,14 +281,14 @@
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 @@
GetWidget()->GetNativeWindow()->SetEventTargeter(
scoped_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() {
@@ -452,13 +446,6 @@
return (params_.max_height != 0) ?
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) {
@@ -495,17 +482,6 @@
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