diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 21:35:48 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-02 21:35:48 +0000 |
commit | 9a6ee3bc91dbb302c73f2355236466cacfeb604f (patch) | |
tree | f5c15b3cd852ef5f0735ec825d34dd767cda9994 /views/widget | |
parent | 9833514789f079b3d8353ce2cf43ec64e4e92b69 (diff) | |
download | chromium_src-9a6ee3bc91dbb302c73f2355236466cacfeb604f.zip chromium_src-9a6ee3bc91dbb302c73f2355236466cacfeb604f.tar.gz chromium_src-9a6ee3bc91dbb302c73f2355236466cacfeb604f.tar.bz2 |
Remove RootView::ConvertPointToMouseHandler.
The function does not seem to do what it claims to do, and it does not seem to
be actually necessary at all. Remove some other unused event constructors.
BUG=chromium-os:14715
TEST=none
Review URL: http://codereview.chromium.org/6883293
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/root_view.cc | 28 | ||||
-rw-r--r-- | views/widget/root_view.h | 9 |
2 files changed, 4 insertions, 33 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index cd9761d..029a84b 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -244,9 +244,7 @@ bool RootView::OnMouseDragged(const MouseEvent& event) { if (mouse_pressed_handler_) { SetMouseLocationAndFlags(e); - gfx::Point p; - ConvertPointToMouseHandler(e.location(), &p); - MouseEvent mouse_event(e.type(), p.x(), p.y(), e.flags()); + MouseEvent mouse_event(e, this, mouse_pressed_handler_); return mouse_pressed_handler_->ProcessMouseDragged(mouse_event, &drag_info); } return false; @@ -257,9 +255,7 @@ void RootView::OnMouseReleased(const MouseEvent& event) { UpdateCursor(e); if (mouse_pressed_handler_) { - gfx::Point p; - ConvertPointToMouseHandler(e.location(), &p); - MouseEvent mouse_released(e.type(), p.x(), p.y(), e.flags()); + MouseEvent mouse_released(e, this, mouse_pressed_handler_); // We allow the view to delete us from ProcessMouseReleased. As such, // configure state such that we're done first, then call View. View* mouse_pressed_handler = mouse_pressed_handler_; @@ -392,7 +388,7 @@ View::TouchStatus RootView::OnTouchEvent(const TouchEvent& event) { #endif void RootView::SetMouseHandler(View *new_mh) { - // If we're clearing the mouse handler, clear explicit_mouse_handler as well. + // If we're clearing the mouse handler, clear explicit_mouse_handler_ as well. explicit_mouse_handler_ = (new_mh != NULL); mouse_pressed_handler_ = new_mh; } @@ -441,24 +437,6 @@ void RootView::OnPaint(gfx::Canvas* canvas) { //////////////////////////////////////////////////////////////////////////////// // RootView, private: -// Coordinate conversion ------------------------------------------------------- - -bool RootView::ConvertPointToMouseHandler(const gfx::Point& l, gfx::Point* p) { - // If the mouse_handler was set explicitly, keep sending events even if it was - // re-parented in a different window. (a non explicit mouse handler is - // automatically cleared when the control is removed from the hierarchy) - *p = l; - if (explicit_mouse_handler_) { - // If the mouse_pressed_handler_ is not connected, we send the - // event in screen coordinate system - ConvertPointToScreen(this, p); - if (mouse_pressed_handler_->GetWidget()) - ConvertPointToView(NULL, mouse_pressed_handler_, p); - } else - ConvertPointToView(this, mouse_pressed_handler_, p); - return true; -} - // Input ----------------------------------------------------------------------- void RootView::UpdateCursor(const MouseEvent& event) { diff --git a/views/widget/root_view.h b/views/widget/root_view.h index 11541d2..8660d4e 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -134,13 +134,6 @@ class RootView : public View, friend class GestureManager; #endif - // Coordinate conversion ----------------------------------------------------- - - // Convert a point to our current mouse handler. Returns false if the - // mouse handler is not connected to a Widget. In that case, the - // conversion cannot take place and |p| is unchanged - bool ConvertPointToMouseHandler(const gfx::Point& l, gfx::Point* p); - // Input --------------------------------------------------------------------- // Update the cursor given a mouse event. This is called by non mouse_move @@ -174,7 +167,7 @@ class RootView : public View, // a double-click lands on the same view as its single-click part. View* last_click_handler_; - // true if mouse_handler_ has been explicitly set + // true if mouse_pressed_handler_ has been explicitly set bool explicit_mouse_handler_; // Last position/flag of a mouse press/drag. Used if capture stops and we need |