Chromium Code Reviews| Index: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h |
| diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8081bbbfa70a18d9e522021af9a8a6b0cbcbabb2 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h |
| @@ -0,0 +1,55 @@ |
| +// 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_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAMEWORK_SERVICE_H_ |
| +#define CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAMEWORK_SERVICE_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "components/arc/arc_service.h" |
| +#include "components/arc/common/voice_interaction_framework.mojom.h" |
| +#include "components/arc/instance_holder.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| +#include "ui/base/accelerators/accelerator.h" |
| + |
| +namespace arc { |
| + |
| +// This provides voice interaction context (currently screenshots) |
| +// to ARC to be used by VoiceInteractionSession. This class lives on the UI |
| +// thread. |
| +class ArcVoiceInteractionFrameworkService |
| + : public ArcService, |
| + public mojom::VoiceInteractionFrameworkHost, |
| + public ui::AcceleratorTarget, |
| + public InstanceHolder< |
| + mojom::VoiceInteractionFrameworkInstance>::Observer { |
| + public: |
| + explicit ArcVoiceInteractionFrameworkService( |
| + ArcBridgeService* bridge_service); |
| + ~ArcVoiceInteractionFrameworkService() override; |
| + |
| + // InstanceHolder<mojom::VoiceInteractionFrameworkInstance> overrides. |
| + void OnInstanceReady() override; |
| + void OnInstanceClosed() override; |
| + |
| + // ui::AcceleratorTarget overrides. |
| + bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| + bool CanHandleAccelerators() const override; |
| + |
| + // mojom::VoiceInteractionFrameworkHost overrides. |
| + void CaptureFocusedWindow( |
| + const CaptureFocusedWindowCallback& callback) override; |
| + |
| + // Whether enable-voice-interaction switch presents. |
|
Luis Héctor Chávez
2017/03/18 03:02:12
nit: s/presents/is present/.
Muyuan
2017/03/19 00:24:15
Done.
|
| + static bool IsVoiceInteractionEnabled(); |
| + |
| + private: |
| + mojo::Binding<mojom::VoiceInteractionFrameworkHost> binding_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionFrameworkService); |
| +}; |
| + |
| +} // namespace arc |
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAMEWORK_SERVICE_H_ |