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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/desktop/desktop_window_root_view.h ('k') | views/events/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/desktop/desktop_window_root_view.h" 5 #include "views/desktop/desktop_window_root_view.h"
6 6
7 #include "views/desktop/desktop_window_view.h" 7 #include "views/desktop/desktop_window_view.h"
8 #include "views/widget/native_widget_view.h" 8 #include "views/widget/native_widget_view.h"
9 #include "views/widget/widget.h" 9 #include "views/widget/widget.h"
10 10
(...skipping 10 matching lines...) Expand all
21 desktop_window_view_(desktop_window_view) { 21 desktop_window_view_(desktop_window_view) {
22 } 22 }
23 23
24 DesktopWindowRootView::~DesktopWindowRootView() { 24 DesktopWindowRootView::~DesktopWindowRootView() {
25 } 25 }
26 26
27 //////////////////////////////////////////////////////////////////////////////// 27 ////////////////////////////////////////////////////////////////////////////////
28 // DesktopWindowRootView, internal::RootView overrides: 28 // DesktopWindowRootView, internal::RootView overrides:
29 29
30 bool DesktopWindowRootView::OnMousePressed(const MouseEvent& event) { 30 bool DesktopWindowRootView::OnMousePressed(const MouseEvent& event) {
31 View* target = GetEventHandlerForPoint(event.location()); 31 ActivateWidgetAtLocation(event.location());
32 return RootView::OnMousePressed(event);
33 }
34
35 ui::TouchStatus DesktopWindowRootView::OnTouchEvent(const TouchEvent& event) {
36 ActivateWidgetAtLocation(event.location());
37 return RootView::OnTouchEvent(event);
38 }
39
40 ////////////////////////////////////////////////////////////////////////////////
41 // DesktopWindowRootView, private
42
43 void DesktopWindowRootView::ActivateWidgetAtLocation(const gfx::Point& point) {
44 View* target = GetEventHandlerForPoint(point);
32 if (target->GetClassName() == internal::NativeWidgetView::kViewClassName) { 45 if (target->GetClassName() == internal::NativeWidgetView::kViewClassName) {
33 internal::NativeWidgetView* native_widget_view = 46 internal::NativeWidgetView* native_widget_view =
34 static_cast<internal::NativeWidgetView*>(target); 47 static_cast<internal::NativeWidgetView*>(target);
35 desktop_window_view_->ActivateWidget( 48 desktop_window_view_->ActivateWidget(
36 native_widget_view->GetAssociatedWidget()); 49 native_widget_view->GetAssociatedWidget());
37 } else { 50 } else {
38 desktop_window_view_->ActivateWidget(NULL); 51 desktop_window_view_->ActivateWidget(NULL);
39 } 52 }
40 return RootView::OnMousePressed(event);
41 } 53 }
42 54
43 } // namespace desktop 55 } // namespace desktop
44 } // namespace views 56 } // namespace views
OLDNEW
« 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