diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 18:48:20 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 18:48:20 +0000 |
commit | e03bbb880a0da6faf4e92d05cf2b8a6f37d33026 (patch) | |
tree | dc1d70be287423a1996896d49fc38c824ab27877 /ui/views/widget/root_view.cc | |
parent | 036e6c978e966cedf14fc6b4c8fa1163de19b53b (diff) | |
download | chromium_src-e03bbb880a0da6faf4e92d05cf2b8a6f37d33026.zip chromium_src-e03bbb880a0da6faf4e92d05cf2b8a6f37d33026.tar.gz chromium_src-e03bbb880a0da6faf4e92d05cf2b8a6f37d33026.tar.bz2 |
Resets drag_info_ when mouse handler is reset.
BUG=98345
TEST=none
R=ben@chromium.org
Review URL: http://codereview.chromium.org/9051007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/widget/root_view.cc')
-rw-r--r-- | ui/views/widget/root_view.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc index d2a54b6..f1882bd1 100644 --- a/ui/views/widget/root_view.cc +++ b/ui/views/widget/root_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -176,9 +176,9 @@ bool RootView::OnMousePressed(const MouseEvent& event) { // event to mouse_pressed_handler_ if (mouse_pressed_handler_) { MouseEvent mouse_pressed_event(e, this, mouse_pressed_handler_); - drag_info.Reset(); + drag_info_.Reset(); mouse_pressed_handler_->ProcessMousePressed(mouse_pressed_event, - &drag_info); + &drag_info_); return true; } DCHECK(!explicit_mouse_handler_); @@ -202,9 +202,9 @@ bool RootView::OnMousePressed(const MouseEvent& event) { if (mouse_pressed_handler_ != last_click_handler_) mouse_pressed_event.set_flags(e.flags() & ~ui::EF_IS_DOUBLE_CLICK); - drag_info.Reset(); + drag_info_.Reset(); bool handled = mouse_pressed_handler_->ProcessMousePressed( - mouse_pressed_event, &drag_info); + mouse_pressed_event, &drag_info_); // The view could have removed itself from the tree when handling // OnMousePressed(). In this case, the removal notification will have @@ -247,7 +247,8 @@ bool RootView::OnMouseDragged(const MouseEvent& event) { SetMouseLocationAndFlags(e); MouseEvent mouse_event(e, this, mouse_pressed_handler_); - return mouse_pressed_handler_->ProcessMouseDragged(mouse_event, &drag_info); + return mouse_pressed_handler_->ProcessMouseDragged(mouse_event, + &drag_info_); } return false; } @@ -393,6 +394,7 @@ void RootView::SetMouseHandler(View *new_mh) { // If we're clearing the mouse handler, clear explicit_mouse_handler_ as well. explicit_mouse_handler_ = (new_mh != NULL); mouse_pressed_handler_ = new_mh; + drag_info_.Reset(); } void RootView::GetAccessibleState(ui::AccessibleViewState* state) { |