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

Side by Side Diff: ui/aura/window_targeter.cc

Issue 110483004: aura: Use EventPrcessor interface for dispatching touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r243178 Created 6 years, 11 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 | « ui/aura/root_window.cc ('k') | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/aura/window_targeter.h" 5 #include "ui/aura/window_targeter.h"
6 6
7 #include "ui/aura/client/capture_client.h" 7 #include "ui/aura/client/capture_client.h"
8 #include "ui/aura/client/event_client.h" 8 #include "ui/aura/client/event_client.h"
9 #include "ui/aura/client/focus_client.h" 9 #include "ui/aura/client/focus_client.h"
10 #include "ui/aura/root_window.h" 10 #include "ui/aura/root_window.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); 95 WindowEventDispatcher* dispatcher = root_window->GetDispatcher();
96 if (dispatcher->mouse_pressed_handler()) 96 if (dispatcher->mouse_pressed_handler())
97 return dispatcher->mouse_pressed_handler(); 97 return dispatcher->mouse_pressed_handler();
98 } 98 }
99 99
100 // All events should be directed towards the capture window (if any). 100 // All events should be directed towards the capture window (if any).
101 Window* capture_window = client::GetCaptureWindow(root_window); 101 Window* capture_window = client::GetCaptureWindow(root_window);
102 if (capture_window) 102 if (capture_window)
103 return capture_window; 103 return capture_window;
104 104
105 if (event.IsTouchEvent()) {
106 // Query the gesture-recognizer to find targets for touch events.
107 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event);
108 ui::GestureConsumer* consumer =
109 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch);
110 if (consumer)
111 return static_cast<Window*>(consumer);
112 consumer =
113 ui::GestureRecognizer::Get()->GetTargetForLocation(event.location());
114 if (consumer)
115 return static_cast<Window*>(consumer);
116
117 // If the initial touch is outside the root window, target the root.
118 if (!root_window->bounds().Contains(event.location()))
119 return root_window;
120 }
121
105 return NULL; 122 return NULL;
106 } 123 }
107 124
108 } // namespace aura 125 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698