OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/autoclick/autoclick_controller.h" | 5 #include "ash/autoclick/autoclick_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/coordinate_conversion.h" | 8 #include "ash/wm/coordinate_conversion.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
11 #include "ui/aura/window_event_dispatcher.h" | 11 #include "ui/aura/window_tree_host.h" |
12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
13 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
14 #include "ui/events/event_handler.h" | 14 #include "ui/events/event_handler.h" |
| 15 #include "ui/events/event_processor.h" |
15 #include "ui/gfx/point.h" | 16 #include "ui/gfx/point.h" |
16 #include "ui/gfx/vector2d.h" | 17 #include "ui/gfx/vector2d.h" |
17 | 18 |
18 namespace ash { | 19 namespace ash { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 // The threshold of mouse movement measured in DIP that will | 23 // The threshold of mouse movement measured in DIP that will |
23 // initiate a new autoclick. | 24 // initiate a new autoclick. |
24 const int kMovementThreshold = 20; | 25 const int kMovementThreshold = 20; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 click_location, | 195 click_location, |
195 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, | 196 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, |
196 ui::EF_LEFT_MOUSE_BUTTON); | 197 ui::EF_LEFT_MOUSE_BUTTON); |
197 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, | 198 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, |
198 click_location, | 199 click_location, |
199 click_location, | 200 click_location, |
200 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, | 201 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, |
201 ui::EF_LEFT_MOUSE_BUTTON); | 202 ui::EF_LEFT_MOUSE_BUTTON); |
202 | 203 |
203 ui::EventDispatchDetails details = | 204 ui::EventDispatchDetails details = |
204 host->dispatcher()->OnEventFromSource(&press_event); | 205 host->event_processor()->OnEventFromSource(&press_event); |
205 if (!details.dispatcher_destroyed) | 206 if (!details.dispatcher_destroyed) |
206 details = host->dispatcher()->OnEventFromSource(&release_event); | 207 details = host->event_processor()->OnEventFromSource(&release_event); |
207 if (details.dispatcher_destroyed) | 208 if (details.dispatcher_destroyed) |
208 return; | 209 return; |
209 } | 210 } |
210 | 211 |
211 // static. | 212 // static. |
212 AutoclickController* AutoclickController::CreateInstance() { | 213 AutoclickController* AutoclickController::CreateInstance() { |
213 return new AutoclickControllerImpl(); | 214 return new AutoclickControllerImpl(); |
214 } | 215 } |
215 | 216 |
216 } // namespace ash | 217 } // namespace ash |
OLD | NEW |