Chromium Code Reviews| 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..9683f743c92c0efd0a735a86f84a60dd706f4279 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/arc_voice_interaction_service.h |
| @@ -0,0 +1,58 @@ |
| +// 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 <memory> |
| + |
| +#include "base/macros.h" |
| +#include "components/arc/arc_service.h" |
| +#include "components/arc/common/voice_interaction.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| +#include "ui/base/accelerators/accelerator.h" |
| + |
| +namespace arc { |
| + |
| +// This provides voice interaction context (screenshots and view hierarchies) |
| +// to Arc to be used by VoiceInteractionSession. This class Lives on the UI |
|
Luis Héctor Chávez
2017/03/13 17:39:34
nit: ARC.
Muyuan
2017/03/14 01:38:14
Done.
|
| +// thread. |
| +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_; |
| + 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_ |