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_MUS_AUTOCLICK_APPLICATION_H_ | 5 #ifndef ASH_AUTOCLICK_MUS_AUTOCLICK_APPLICATION_H_ |
6 #define ASH_AUTOCLICK_MUS_AUTOCLICK_APPLICATION_H_ | 6 #define ASH_AUTOCLICK_MUS_AUTOCLICK_APPLICATION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "ash/autoclick/common/autoclick_controller_common.h" | 10 #include "ash/autoclick/common/autoclick_controller_common.h" |
11 #include "ash/autoclick/common/autoclick_controller_common_delegate.h" | 11 #include "ash/autoclick/common/autoclick_controller_common_delegate.h" |
12 #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h" | 12 #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "mash/public/interfaces/launchable.mojom.h" | 14 #include "mash/public/interfaces/launchable.mojom.h" |
15 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
| 16 #include "services/service_manager/public/cpp/binder_registry.h" |
16 #include "services/service_manager/public/cpp/identity.h" | 17 #include "services/service_manager/public/cpp/identity.h" |
17 #include "services/service_manager/public/cpp/interface_registry.h" | |
18 #include "services/service_manager/public/cpp/service.h" | 18 #include "services/service_manager/public/cpp/service.h" |
19 | 19 |
20 namespace views { | 20 namespace views { |
21 class AuraInit; | 21 class AuraInit; |
22 class Widget; | 22 class Widget; |
23 } | 23 } |
24 | 24 |
25 namespace ash { | 25 namespace ash { |
26 namespace autoclick { | 26 namespace autoclick { |
27 | 27 |
28 class AutoclickApplication | 28 class AutoclickApplication |
29 : public service_manager::Service, | 29 : public service_manager::Service, |
30 public mash::mojom::Launchable, | 30 public mash::mojom::Launchable, |
31 public mojom::AutoclickController, | 31 public mojom::AutoclickController, |
32 public service_manager::InterfaceFactory<mash::mojom::Launchable>, | 32 public service_manager::InterfaceFactory<mash::mojom::Launchable>, |
33 public service_manager::InterfaceFactory<mojom::AutoclickController>, | 33 public service_manager::InterfaceFactory<mojom::AutoclickController>, |
34 public AutoclickControllerCommonDelegate { | 34 public AutoclickControllerCommonDelegate { |
35 public: | 35 public: |
36 AutoclickApplication(); | 36 AutoclickApplication(); |
37 ~AutoclickApplication() override; | 37 ~AutoclickApplication() override; |
38 | 38 |
39 private: | 39 private: |
40 // service_manager::Service: | 40 // service_manager::Service: |
41 void OnStart() override; | 41 void OnStart() override; |
42 bool OnConnect(const service_manager::ServiceInfo& remote_info, | 42 void OnBindInterface(const service_manager::ServiceInfo& remote_info, |
43 service_manager::InterfaceRegistry* registry) override; | 43 const std::string& interface_name, |
| 44 mojo::ScopedMessagePipeHandle interface_pipe) override; |
44 | 45 |
45 // mojom::Launchable: | 46 // mojom::Launchable: |
46 void Launch(uint32_t what, mash::mojom::LaunchMode how) override; | 47 void Launch(uint32_t what, mash::mojom::LaunchMode how) override; |
47 | 48 |
48 // mojom::AutoclickController: | 49 // mojom::AutoclickController: |
49 void SetAutoclickDelay(uint32_t delay_in_milliseconds) override; | 50 void SetAutoclickDelay(uint32_t delay_in_milliseconds) override; |
50 | 51 |
51 // service_manager::InterfaceFactory<mojom::Launchable>: | 52 // service_manager::InterfaceFactory<mojom::Launchable>: |
52 void Create(const service_manager::Identity& remote_identity, | 53 void Create(const service_manager::Identity& remote_identity, |
53 mash::mojom::LaunchableRequest request) override; | 54 mash::mojom::LaunchableRequest request) override; |
54 | 55 |
55 // service_manager::InterfaceFactory<mojom::AutoclickController>: | 56 // service_manager::InterfaceFactory<mojom::AutoclickController>: |
56 void Create(const service_manager::Identity& remote_identity, | 57 void Create(const service_manager::Identity& remote_identity, |
57 mojom::AutoclickControllerRequest request) override; | 58 mojom::AutoclickControllerRequest request) override; |
58 | 59 |
59 // AutoclickControllerCommonDelegate: | 60 // AutoclickControllerCommonDelegate: |
60 views::Widget* CreateAutoclickRingWidget( | 61 views::Widget* CreateAutoclickRingWidget( |
61 const gfx::Point& event_location) override; | 62 const gfx::Point& event_location) override; |
62 void UpdateAutoclickRingWidget(views::Widget* widget, | 63 void UpdateAutoclickRingWidget(views::Widget* widget, |
63 const gfx::Point& event_location) override; | 64 const gfx::Point& event_location) override; |
64 void DoAutoclick(const gfx::Point& event_location, | 65 void DoAutoclick(const gfx::Point& event_location, |
65 const int mouse_event_flags) override; | 66 const int mouse_event_flags) override; |
66 void OnAutoclickCanceled() override; | 67 void OnAutoclickCanceled() override; |
67 | 68 |
| 69 service_manager::BinderRegistry registry_; |
68 mojo::Binding<mash::mojom::Launchable> launchable_binding_; | 70 mojo::Binding<mash::mojom::Launchable> launchable_binding_; |
69 mojo::Binding<mojom::AutoclickController> autoclick_binding_; | 71 mojo::Binding<mojom::AutoclickController> autoclick_binding_; |
70 | 72 |
71 std::unique_ptr<views::AuraInit> aura_init_; | 73 std::unique_ptr<views::AuraInit> aura_init_; |
72 std::unique_ptr<AutoclickControllerCommon> autoclick_controller_common_; | 74 std::unique_ptr<AutoclickControllerCommon> autoclick_controller_common_; |
73 std::unique_ptr<views::Widget> widget_; | 75 std::unique_ptr<views::Widget> widget_; |
74 | 76 |
75 DISALLOW_COPY_AND_ASSIGN(AutoclickApplication); | 77 DISALLOW_COPY_AND_ASSIGN(AutoclickApplication); |
76 }; | 78 }; |
77 | 79 |
78 } // namespace autoclick | 80 } // namespace autoclick |
79 } // namespace ash | 81 } // namespace ash |
80 | 82 |
81 #endif // ASH_AUTOCLICK_MUS_AUTOCLICK_APPLICATION_H_ | 83 #endif // ASH_AUTOCLICK_MUS_AUTOCLICK_APPLICATION_H_ |
OLD | NEW |