| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 // static. | 41 // static. |
| 42 const int AutoclickController::kDefaultAutoclickDelayMs = 400; | 42 const int AutoclickController::kDefaultAutoclickDelayMs = 400; |
| 43 | 43 |
| 44 class AutoclickControllerImpl : public AutoclickController, | 44 class AutoclickControllerImpl : public AutoclickController, |
| 45 public ui::EventHandler { | 45 public ui::EventHandler { |
| 46 public: | 46 public: |
| 47 AutoclickControllerImpl(); | 47 AutoclickControllerImpl(); |
| 48 virtual ~AutoclickControllerImpl(); | 48 ~AutoclickControllerImpl() override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // AutoclickController overrides: | 51 // AutoclickController overrides: |
| 52 virtual void SetEnabled(bool enabled) override; | 52 void SetEnabled(bool enabled) override; |
| 53 virtual bool IsEnabled() const override; | 53 bool IsEnabled() const override; |
| 54 virtual void SetAutoclickDelay(int delay_ms) override; | 54 void SetAutoclickDelay(int delay_ms) override; |
| 55 virtual int GetAutoclickDelay() const override; | 55 int GetAutoclickDelay() const override; |
| 56 | 56 |
| 57 // ui::EventHandler overrides: | 57 // ui::EventHandler overrides: |
| 58 virtual void OnMouseEvent(ui::MouseEvent* event) override; | 58 void OnMouseEvent(ui::MouseEvent* event) override; |
| 59 virtual void OnKeyEvent(ui::KeyEvent* event) override; | 59 void OnKeyEvent(ui::KeyEvent* event) override; |
| 60 virtual void OnTouchEvent(ui::TouchEvent* event) override; | 60 void OnTouchEvent(ui::TouchEvent* event) override; |
| 61 virtual void OnGestureEvent(ui::GestureEvent* event) override; | 61 void OnGestureEvent(ui::GestureEvent* event) override; |
| 62 virtual void OnScrollEvent(ui::ScrollEvent* event) override; | 62 void OnScrollEvent(ui::ScrollEvent* event) override; |
| 63 | 63 |
| 64 void InitClickTimer(); | 64 void InitClickTimer(); |
| 65 | 65 |
| 66 void DoAutoclick(); | 66 void DoAutoclick(); |
| 67 | 67 |
| 68 bool enabled_; | 68 bool enabled_; |
| 69 int delay_ms_; | 69 int delay_ms_; |
| 70 int mouse_event_flags_; | 70 int mouse_event_flags_; |
| 71 scoped_ptr<base::Timer> autoclick_timer_; | 71 scoped_ptr<base::Timer> autoclick_timer_; |
| 72 // The position in screen coordinates used to determine | 72 // The position in screen coordinates used to determine |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (details.dispatcher_destroyed) | 208 if (details.dispatcher_destroyed) |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 | 211 |
| 212 // static. | 212 // static. |
| 213 AutoclickController* AutoclickController::CreateInstance() { | 213 AutoclickController* AutoclickController::CreateInstance() { |
| 214 return new AutoclickControllerImpl(); | 214 return new AutoclickControllerImpl(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace ash | 217 } // namespace ash |
| OLD | NEW |