OLD | NEW |
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return capture_window; | 103 return capture_window; |
104 | 104 |
105 if (event.IsTouchEvent()) { | 105 if (event.IsTouchEvent()) { |
106 // Query the gesture-recognizer to find targets for touch events. | 106 // Query the gesture-recognizer to find targets for touch events. |
107 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event); | 107 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event); |
108 ui::GestureConsumer* consumer = | 108 ui::GestureConsumer* consumer = |
109 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch); | 109 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch); |
110 if (consumer) | 110 if (consumer) |
111 return static_cast<Window*>(consumer); | 111 return static_cast<Window*>(consumer); |
112 consumer = | 112 consumer = |
113 ui::GestureRecognizer::Get()->GetTargetForLocation(event.location()); | 113 ui::GestureRecognizer::Get()->GetTargetForLocation( |
| 114 event.location(), touch.source_device_id()); |
114 if (consumer) | 115 if (consumer) |
115 return static_cast<Window*>(consumer); | 116 return static_cast<Window*>(consumer); |
116 | 117 |
117 // If the initial touch is outside the root window, target the root. | 118 // If the initial touch is outside the root window, target the root. |
118 if (!root_window->bounds().Contains(event.location())) | 119 if (!root_window->bounds().Contains(event.location())) |
119 return root_window; | 120 return root_window; |
120 } | 121 } |
121 | 122 |
122 return NULL; | 123 return NULL; |
123 } | 124 } |
124 | 125 |
125 } // namespace aura | 126 } // namespace aura |
OLD | NEW |