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

Unified Diff: ui/views/widget/root_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/widget/root_view.h ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index f3b1a8296b1c91193ab6a328be809ced7f10a783..cbfb8c4a95dffa42d8ffa0e11797a44fcfd765f0 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -157,7 +157,6 @@ RootView::RootView(Widget* widget)
mouse_move_handler_(NULL),
last_click_handler_(NULL),
explicit_mouse_handler_(false),
- clear_mouse_handler_on_release_(true),
last_mouse_event_flags_(0),
last_mouse_event_x_(-1),
last_mouse_event_y_(-1),
@@ -443,8 +442,7 @@ void RootView::OnMouseReleased(const ui::MouseEvent& event) {
// We allow the view to delete us from the event dispatch callback. As such,
// configure state such that we're done first, then call View.
View* mouse_pressed_handler = mouse_pressed_handler_;
- if (clear_mouse_handler_on_release_)
- SetMouseHandler(nullptr);
+ SetMouseHandler(NULL);
ui::EventDispatchDetails dispatch_details =
DispatchEvent(mouse_pressed_handler, &mouse_released);
if (dispatch_details.dispatcher_destroyed)
@@ -595,7 +593,11 @@ bool RootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
}
void RootView::SetMouseHandler(View* new_mh) {
- SetMouseHandler(new_mh, true /* clear_on_release */);
+ // If we're clearing the mouse handler, clear explicit_mouse_handler_ as well.
+ explicit_mouse_handler_ = (new_mh != NULL);
+ mouse_pressed_handler_ = new_mh;
+ gesture_handler_ = new_mh;
+ drag_info_.Reset();
}
void RootView::GetAccessibleState(ui::AXViewState* state) {
@@ -635,7 +637,6 @@ void RootView::VisibilityChanged(View* /*starting_from*/, bool is_visible) {
// handlers are reset, so that after it is reshown, events are not captured
// by old handlers.
explicit_mouse_handler_ = false;
- clear_mouse_handler_on_release_ = true;
mouse_pressed_handler_ = NULL;
mouse_move_handler_ = NULL;
gesture_handler_ = NULL;
@@ -705,15 +706,6 @@ ui::EventDispatchDetails RootView::NotifyEnterExitOfDescendant(
return ui::EventDispatchDetails();
}
-void RootView::SetMouseHandler(View* new_mh, bool clear_on_release) {
- // If we're clearing the mouse handler, clear explicit_mouse_handler_ as well.
- explicit_mouse_handler_ = (new_mh != nullptr);
- clear_mouse_handler_on_release_ = clear_on_release;
- mouse_pressed_handler_ = new_mh;
- gesture_handler_ = new_mh;
- drag_info_.Reset();
-}
-
bool RootView::CanDispatchToTarget(ui::EventTarget* target) {
return event_dispatch_target_ == target;
}
« no previous file with comments | « ui/views/widget/root_view.h ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698