| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 gfx::Point click_location(screen_location); | 184 gfx::Point click_location(screen_location); |
| 185 anchor_location_ = click_location; | 185 anchor_location_ = click_location; |
| 186 wm::ConvertPointFromScreen(root_window, &click_location); | 186 wm::ConvertPointFromScreen(root_window, &click_location); |
| 187 | 187 |
| 188 aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); | 188 aura::WindowEventDispatcher* dispatcher = root_window->GetDispatcher(); |
| 189 dispatcher->ConvertPointToHost(&click_location); | 189 dispatcher->ConvertPointToHost(&click_location); |
| 190 | 190 |
| 191 ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, | 191 ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, |
| 192 click_location, | 192 click_location, |
| 193 click_location, | 193 click_location, |
| 194 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON); | 194 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, |
| 195 ui::EF_LEFT_MOUSE_BUTTON); |
| 195 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, | 196 ui::MouseEvent release_event(ui::ET_MOUSE_RELEASED, |
| 196 click_location, | 197 click_location, |
| 197 click_location, | 198 click_location, |
| 198 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON); | 199 mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON, |
| 200 ui::EF_LEFT_MOUSE_BUTTON); |
| 199 | 201 |
| 200 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event); | 202 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event); |
| 201 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event); | 203 dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event); |
| 202 } | 204 } |
| 203 | 205 |
| 204 // static. | 206 // static. |
| 205 AutoclickController* AutoclickController::CreateInstance() { | 207 AutoclickController* AutoclickController::CreateInstance() { |
| 206 return new AutoclickControllerImpl(); | 208 return new AutoclickControllerImpl(); |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace ash | 211 } // namespace ash |
| OLD | NEW |