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" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 click_location, | 193 click_location, |
194 click_location, | 194 click_location, |
195 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, | 195 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, |
196 ui::EF_LEFT_MOUSE_BUTTON); | 196 ui::EF_LEFT_MOUSE_BUTTON); |
197 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, | 197 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, |
198 click_location, | 198 click_location, |
199 click_location, | 199 click_location, |
200 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, | 200 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, |
201 ui::EF_LEFT_MOUSE_BUTTON); | 201 ui::EF_LEFT_MOUSE_BUTTON); |
202 | 202 |
203 dispatcher->AsWindowTreeHostDelegate()->OnHostMouseEvent(&press_event); | 203 ui::EventDispatchDetails details = |
204 dispatcher->AsWindowTreeHostDelegate()->OnHostMouseEvent(&release_event); | 204 dispatcher->OnEventFromSource(&press_event); |
| 205 if (!details.dispatcher_destroyed) |
| 206 details = dispatcher->OnEventFromSource(&release_event); |
| 207 if (details.dispatcher_destroyed) |
| 208 return; |
205 } | 209 } |
206 | 210 |
207 // static. | 211 // static. |
208 AutoclickController* AutoclickController::CreateInstance() { | 212 AutoclickController* AutoclickController::CreateInstance() { |
209 return new AutoclickControllerImpl(); | 213 return new AutoclickControllerImpl(); |
210 } | 214 } |
211 | 215 |
212 } // namespace ash | 216 } // namespace ash |
OLD | NEW |