Chromium Code Reviews| Index: ui/views/widget/root_view.h |
| diff --git a/ui/views/widget/root_view.h b/ui/views/widget/root_view.h |
| index 58c647fccefb4c89d195fdd1627a73bea6e2eeb6..35e83ad3d064c4a542506becc1afc71c676cf9ab 100644 |
| --- a/ui/views/widget/root_view.h |
| +++ b/ui/views/widget/root_view.h |
| @@ -159,6 +159,12 @@ class VIEWS_EXPORT RootView : public View, |
| View* view, |
| View* sibling) WARN_UNUSED_RESULT; |
| + // Specialized version of SetMouseHandler(). If |clear_on_release| is true the |
| + // mouse handler will be cleared on mouse release, which is the common case |
| + // and used for drags. If |clear_on_release| is false then the mouse handler |
| + // must be explicitly by calling SetMouseHandler() with null. |
|
msw
2016/04/11 16:52:20
nit: 'explicitly released'
|
| + void SetMouseHandler(View* view, bool clear_on_release); |
| + |
| // Overridden from ui::EventDispatcherDelegate: |
| bool CanDispatchToTarget(ui::EventTarget* target) override; |
| ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, |
| @@ -187,9 +193,13 @@ class VIEWS_EXPORT RootView : public View, |
| // a double-click lands on the same view as its single-click part. |
| View* last_click_handler_; |
| - // true if mouse_pressed_handler_ has been explicitly set |
| + // True if mouse_pressed_handler_ has been explicitly set. |
| bool explicit_mouse_handler_; |
| + // True if mouse_pressed_handler_ should be automatically cleared on mouse |
| + // release, as is common during drags. |
| + bool clear_mouse_handler_on_release_; |
| + |
| // Last position/flag of a mouse press/drag. Used if capture stops and we need |
| // to synthesize a release. |
| int last_mouse_event_flags_; |