OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/arc/arc_service.h" | |
10 #include "components/arc/common/voice_interaction.mojom.h" | |
11 #include "components/arc/instance_holder.h" | |
hidehiko
2017/03/10 06:14:50
nit: Looks unused. Move to .cc?
Muyuan
2017/03/10 22:36:10
Done.
| |
12 #include "mojo/public/cpp/bindings/binding.h" | |
13 #include "ui/base/accelerators/accelerator.h" | |
14 | |
15 namespace arc { | |
16 | |
17 // Lives on the UI thread. | |
hidehiko
2017/03/10 06:14:49
Could you document what is the responsibility of t
Muyuan
2017/03/10 22:36:10
Done.
| |
18 class ArcVoiceInteractionService : public ArcService, | |
19 public mojom::VoiceInteractionHost, | |
20 public ui::AcceleratorTarget { | |
21 public: | |
22 explicit ArcVoiceInteractionService(ArcBridgeService* bridge_service); | |
23 ~ArcVoiceInteractionService() override; | |
24 | |
25 void OnCaptureInstanceReady(); | |
26 void OnCaptureInstanceClosed(); | |
27 | |
28 void OnArcHomeInstanceReady(); | |
29 void OnArcHomeInstanceClosed(); | |
30 | |
31 // ui::AcceleratorTarget overrides. | |
32 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | |
33 bool CanHandleAccelerators() const override; | |
34 | |
35 // mojom::VoiceInteractionHost overrides. | |
36 void GetVoiceInteractionStructure( | |
37 const GetVoiceInteractionStructureCallback& callback) override; | |
38 void CaptureFocusedWindow( | |
39 const CaptureFocusedWindowCallback& callback) override; | |
40 | |
41 private: | |
42 class ArcHomeObserver; | |
43 class CaptureObserver; | |
44 | |
45 std::unique_ptr<ArcHomeObserver> home_observer_; | |
hidehiko
2017/03/10 06:14:50
nit: Please
#include <memory>
Muyuan
2017/03/10 22:36:10
Done.
| |
46 std::unique_ptr<CaptureObserver> capture_observer_; | |
47 | |
48 mojo::Binding<mojom::VoiceInteractionHost> home_binding_; | |
49 mojo::Binding<mojom::VoiceInteractionHost> capture_binding_; | |
50 | |
51 DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionService); | |
52 }; | |
53 | |
54 } // namespace arc | |
55 | |
56 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_ | |
OLD | NEW |