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

Unified Diff: views/desktop/desktop_window_root_view.cc

Issue 7540002: Fix a few issues with touch-events and views-desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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/desktop/desktop_window_root_view.h ('k') | views/events/event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/desktop/desktop_window_root_view.cc
diff --git a/views/desktop/desktop_window_root_view.cc b/views/desktop/desktop_window_root_view.cc
index f8311ae3d6b945e3aa4335e19f7e0bdbfc6c5ba5..4f1d5ca0c74bb2431dc5db8bf2e1fd9f81f646d5 100644
--- a/views/desktop/desktop_window_root_view.cc
+++ b/views/desktop/desktop_window_root_view.cc
@@ -28,7 +28,20 @@ DesktopWindowRootView::~DesktopWindowRootView() {
// DesktopWindowRootView, internal::RootView overrides:
bool DesktopWindowRootView::OnMousePressed(const MouseEvent& event) {
- View* target = GetEventHandlerForPoint(event.location());
+ ActivateWidgetAtLocation(event.location());
+ return RootView::OnMousePressed(event);
+}
+
+ui::TouchStatus DesktopWindowRootView::OnTouchEvent(const TouchEvent& event) {
+ ActivateWidgetAtLocation(event.location());
+ return RootView::OnTouchEvent(event);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// DesktopWindowRootView, private
+
+void DesktopWindowRootView::ActivateWidgetAtLocation(const gfx::Point& point) {
+ View* target = GetEventHandlerForPoint(point);
if (target->GetClassName() == internal::NativeWidgetView::kViewClassName) {
internal::NativeWidgetView* native_widget_view =
static_cast<internal::NativeWidgetView*>(target);
@@ -37,7 +50,6 @@ bool DesktopWindowRootView::OnMousePressed(const MouseEvent& event) {
} else {
desktop_window_view_->ActivateWidget(NULL);
}
- return RootView::OnMousePressed(event);
}
} // namespace desktop
« no previous file with comments | « views/desktop/desktop_window_root_view.h ('k') | views/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698