| 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/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (capture_window) | 145 if (capture_window) |
| 146 return capture_window; | 146 return capture_window; |
| 147 | 147 |
| 148 if (event.IsTouchEvent()) { | 148 if (event.IsTouchEvent()) { |
| 149 // Query the gesture-recognizer to find targets for touch events. | 149 // Query the gesture-recognizer to find targets for touch events. |
| 150 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event); | 150 const ui::TouchEvent& touch = static_cast<const ui::TouchEvent&>(event); |
| 151 ui::GestureConsumer* consumer = | 151 ui::GestureConsumer* consumer = |
| 152 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch); | 152 ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch); |
| 153 if (consumer) | 153 if (consumer) |
| 154 return static_cast<Window*>(consumer); | 154 return static_cast<Window*>(consumer); |
| 155 consumer = | 155 consumer = ui::GestureRecognizer::Get()->GetTargetForLocation( |
| 156 ui::GestureRecognizer::Get()->GetTargetForLocation( | 156 event.location_f(), touch.source_device_id()); |
| 157 event.location(), touch.source_device_id()); | |
| 158 if (consumer) | 157 if (consumer) |
| 159 return static_cast<Window*>(consumer); | 158 return static_cast<Window*>(consumer); |
| 160 | 159 |
| 161 // If the initial touch is outside the root window, target the root. | 160 // If the initial touch is outside the root window, target the root. |
| 162 if (!root_window->bounds().Contains(event.location())) | 161 if (!root_window->bounds().Contains(event.location())) |
| 163 return root_window; | 162 return root_window; |
| 164 } | 163 } |
| 165 | 164 |
| 166 return nullptr; | 165 return nullptr; |
| 167 } | 166 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 188 static_cast<Window*>(targeter->FindTargetForEvent(child, event)); | 187 static_cast<Window*>(targeter->FindTargetForEvent(child, event)); |
| 189 if (child_target_window) | 188 if (child_target_window) |
| 190 return child_target_window; | 189 return child_target_window; |
| 191 } | 190 } |
| 192 target->ConvertEventToTarget(root_window, event); | 191 target->ConvertEventToTarget(root_window, event); |
| 193 } | 192 } |
| 194 return root_window->CanAcceptEvent(*event) ? root_window : nullptr; | 193 return root_window->CanAcceptEvent(*event) ? root_window : nullptr; |
| 195 } | 194 } |
| 196 | 195 |
| 197 } // namespace aura | 196 } // namespace aura |
| OLD | NEW |