Index: chrome/browser/chromeos/arc/arc_voice_interaction_service.h |
diff --git a/chrome/browser/chromeos/arc/arc_voice_interaction_service.h b/chrome/browser/chromeos/arc/arc_voice_interaction_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..00ebed1205fe6d421e4bbbc1cf9ce1f440edc807 |
--- /dev/null |
+++ b/chrome/browser/chromeos/arc/arc_voice_interaction_service.h |
@@ -0,0 +1,56 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_ |
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_ |
+ |
+#include "base/macros.h" |
+#include "components/arc/arc_service.h" |
+#include "components/arc/common/voice_interaction.mojom.h" |
+#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.
|
+#include "mojo/public/cpp/bindings/binding.h" |
+#include "ui/base/accelerators/accelerator.h" |
+ |
+namespace arc { |
+ |
+// 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.
|
+class ArcVoiceInteractionService : public ArcService, |
+ public mojom::VoiceInteractionHost, |
+ public ui::AcceleratorTarget { |
+ public: |
+ explicit ArcVoiceInteractionService(ArcBridgeService* bridge_service); |
+ ~ArcVoiceInteractionService() override; |
+ |
+ void OnCaptureInstanceReady(); |
+ void OnCaptureInstanceClosed(); |
+ |
+ void OnArcHomeInstanceReady(); |
+ void OnArcHomeInstanceClosed(); |
+ |
+ // ui::AcceleratorTarget overrides. |
+ bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
+ bool CanHandleAccelerators() const override; |
+ |
+ // mojom::VoiceInteractionHost overrides. |
+ void GetVoiceInteractionStructure( |
+ const GetVoiceInteractionStructureCallback& callback) override; |
+ void CaptureFocusedWindow( |
+ const CaptureFocusedWindowCallback& callback) override; |
+ |
+ private: |
+ class ArcHomeObserver; |
+ class CaptureObserver; |
+ |
+ 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.
|
+ std::unique_ptr<CaptureObserver> capture_observer_; |
+ |
+ mojo::Binding<mojom::VoiceInteractionHost> home_binding_; |
+ mojo::Binding<mojom::VoiceInteractionHost> capture_binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionService); |
+}; |
+ |
+} // namespace arc |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_ |