| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_DELEGATE_H | 5 #ifndef ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_DELEGATE_H |
| 6 #define ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_DELEGATE_H | 6 #define ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_DELEGATE_H |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| 11 class Widget; | 11 class Widget; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Point; | 15 class Point; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 | 19 |
| 20 class AutoclickControllerCommonDelegate { | 20 class AutoclickControllerCommonDelegate { |
| 21 public: | 21 public: |
| 22 AutoclickControllerCommonDelegate() {} | 22 AutoclickControllerCommonDelegate() {} |
| 23 virtual ~AutoclickControllerCommonDelegate() {} | 23 virtual ~AutoclickControllerCommonDelegate() {} |
| 24 | 24 |
| 25 // Creates a ring widget at |event_location|. AutoclickControllerCommon | 25 // Creates a ring widget at |event_location|. |
| 26 // takes ownership of the created widget. | 26 // AutoclickControllerCommonDelegate still has ownership of the widget they |
| 27 virtual std::unique_ptr<views::Widget> CreateAutoclickRingWidget( | 27 // created. |
| 28 virtual views::Widget* CreateAutoclickRingWidget( |
| 28 const gfx::Point& event_location) = 0; | 29 const gfx::Point& event_location) = 0; |
| 29 | 30 |
| 30 // Moves |widget| to |event_location|. | 31 // Moves |widget| to |event_location|. |
| 31 virtual void UpdateAutoclickRingWidget(views::Widget* widget, | 32 virtual void UpdateAutoclickRingWidget(views::Widget* widget, |
| 32 const gfx::Point& event_location) = 0; | 33 const gfx::Point& event_location) = 0; |
| 33 | 34 |
| 34 // Generates a click with |mouse_event_flags| at |event_location|. | 35 // Generates a click with |mouse_event_flags| at |event_location|. |
| 35 virtual void DoAutoclick(const gfx::Point& event_location, | 36 virtual void DoAutoclick(const gfx::Point& event_location, |
| 36 const int mouse_event_flags) = 0; | 37 const int mouse_event_flags) = 0; |
| 37 | 38 |
| 38 virtual void OnAutoclickCanceled() = 0; | 39 virtual void OnAutoclickCanceled() = 0; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 DISALLOW_COPY_AND_ASSIGN(AutoclickControllerCommonDelegate); | 42 DISALLOW_COPY_AND_ASSIGN(AutoclickControllerCommonDelegate); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace ash | 45 } // namespace ash |
| 45 | 46 |
| 46 #endif // ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_DELEGATE_H | 47 #endif // ASH_AUTOCLICK_COMMON_AUTOCLICK_CONTROLLER_COMMON_DELEGATE_H |
| OLD | NEW |