| 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_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAM
EWORK_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAM
EWORK_SERVICE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/arc/arc_service.h" | |
| 12 #include "components/arc/common/voice_interaction_framework.mojom.h" | |
| 13 #include "components/arc/instance_holder.h" | |
| 14 #include "mojo/public/cpp/bindings/binding.h" | |
| 15 #include "ui/base/accelerators/accelerator.h" | |
| 16 | |
| 17 namespace arc { | |
| 18 | |
| 19 // This provides voice interaction context (currently screenshots) | |
| 20 // to ARC to be used by VoiceInteractionSession. This class lives on the UI | |
| 21 // thread. | |
| 22 class ArcVoiceInteractionFrameworkService | |
| 23 : public ArcService, | |
| 24 public mojom::VoiceInteractionFrameworkHost, | |
| 25 public ui::AcceleratorTarget, | |
| 26 public InstanceHolder< | |
| 27 mojom::VoiceInteractionFrameworkInstance>::Observer { | |
| 28 public: | |
| 29 explicit ArcVoiceInteractionFrameworkService( | |
| 30 ArcBridgeService* bridge_service); | |
| 31 ~ArcVoiceInteractionFrameworkService() override; | |
| 32 | |
| 33 // InstanceHolder<mojom::VoiceInteractionFrameworkInstance> overrides. | |
| 34 void OnInstanceReady() override; | |
| 35 void OnInstanceClosed() override; | |
| 36 | |
| 37 // ui::AcceleratorTarget overrides. | |
| 38 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | |
| 39 bool CanHandleAccelerators() const override; | |
| 40 | |
| 41 // mojom::VoiceInteractionFrameworkHost overrides. | |
| 42 void CaptureFocusedWindow( | |
| 43 const CaptureFocusedWindowCallback& callback) override; | |
| 44 | |
| 45 // Whether enable-voice-interaction switch is present. | |
| 46 static bool IsVoiceInteractionEnabled(); | |
| 47 | |
| 48 private: | |
| 49 mojo::Binding<mojom::VoiceInteractionFrameworkHost> binding_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionFrameworkService); | |
| 52 }; | |
| 53 | |
| 54 } // namespace arc | |
| 55 #endif // CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_F
RAMEWORK_SERVICE_H_ | |
| OLD | NEW |