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

Unified Diff: views/widget/widget.h

Issue 6756043: Consolidate Widget Event code, other cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge. Created 9 years, 9 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 | « views/widget/tooltip_manager_win.h ('k') | views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget.h
diff --git a/views/widget/widget.h b/views/widget/widget.h
index b0e22a31abfbf462ae2500bdc8b58bd504e9e49f..eb613615b386a81b3b1088995092b84ec922849a 100644
--- a/views/widget/widget.h
+++ b/views/widget/widget.h
@@ -274,6 +274,8 @@ class Widget : public internal::NativeWidgetDelegate,
virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE;
virtual bool HasFocusManager() const OVERRIDE;
virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE;
+ virtual void OnMouseCaptureLost() OVERRIDE;
// Overridden from FocusTraversable:
virtual FocusSearch* GetFocusSearch() OVERRIDE;
@@ -300,6 +302,17 @@ class Widget : public internal::NativeWidgetDelegate,
// Used for testing.
void ReplaceFocusManager(FocusManager* focus_manager);
+ // TODO(msw): Make this mouse state member private.
+ // If true, the mouse is currently down.
+ bool is_mouse_button_pressed_;
+
+ // TODO(msw): Make these mouse state members private.
+ // The following are used to detect duplicate mouse move events and not
+ // deliver them. Displaying a window may result in the system generating
+ // duplicate move events even though the mouse hasn't moved.
+ bool last_mouse_event_was_move_;
+ gfx::Point last_mouse_event_position_;
+
private:
// Refresh the compositor tree. This is called by a View whenever its texture
// is updated.
@@ -309,6 +322,9 @@ class Widget : public internal::NativeWidgetDelegate,
// a compositor couldn't be created.
bool EnsureCompositor();
+ // Returns whether capture should be released on mouse release.
+ virtual bool ShouldReleaseCaptureOnMouseReleased() const { return true; }
+
NativeWidget* native_widget_;
// Non-owned pointer to the Widget's delegate. May be NULL if no delegate is
« no previous file with comments | « views/widget/tooltip_manager_win.h ('k') | views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698