| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAM
EWORK_SERVICE_H_ | 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_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_FRAM
EWORK_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/arc/arc_service.h" | 11 #include "components/arc/arc_service.h" |
| 12 #include "components/arc/common/voice_interaction_framework.mojom.h" | 12 #include "components/arc/common/voice_interaction_framework.mojom.h" |
| 13 #include "components/arc/instance_holder.h" | 13 #include "components/arc/instance_holder.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "ui/base/accelerators/accelerator.h" | 15 #include "ui/base/accelerators/accelerator.h" |
| 16 | 16 |
| 17 namespace gfx { |
| 18 class Image; |
| 19 } // gfx |
| 20 |
| 21 namespace ui { |
| 22 class LayerTreeOwner; |
| 23 } // namespace ui |
| 24 |
| 17 namespace arc { | 25 namespace arc { |
| 18 | 26 |
| 19 // This provides voice interaction context (currently screenshots) | 27 // This provides voice interaction context (currently screenshots) |
| 20 // to ARC to be used by VoiceInteractionSession. This class lives on the UI | 28 // to ARC to be used by VoiceInteractionSession. This class lives on the UI |
| 21 // thread. | 29 // thread. |
| 22 class ArcVoiceInteractionFrameworkService | 30 class ArcVoiceInteractionFrameworkService |
| 23 : public ArcService, | 31 : public ArcService, |
| 24 public mojom::VoiceInteractionFrameworkHost, | 32 public mojom::VoiceInteractionFrameworkHost, |
| 25 public ui::AcceleratorTarget, | 33 public ui::AcceleratorTarget, |
| 26 public InstanceHolder< | 34 public InstanceHolder< |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 46 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 39 bool CanHandleAccelerators() const override; | 47 bool CanHandleAccelerators() const override; |
| 40 | 48 |
| 41 // mojom::VoiceInteractionFrameworkHost overrides. | 49 // mojom::VoiceInteractionFrameworkHost overrides. |
| 42 void CaptureFocusedWindow( | 50 void CaptureFocusedWindow( |
| 43 const CaptureFocusedWindowCallback& callback) override; | 51 const CaptureFocusedWindowCallback& callback) override; |
| 44 void CaptureFullscreen(const CaptureFullscreenCallback& callback) override; | 52 void CaptureFullscreen(const CaptureFullscreenCallback& callback) override; |
| 45 void OnMetalayerClosed() override; | 53 void OnMetalayerClosed() override; |
| 46 void SetMetalayerEnabled(bool enabled) override; | 54 void SetMetalayerEnabled(bool enabled) override; |
| 47 | 55 |
| 56 void EncodeAndReturnImage(const CaptureFullscreenCallback& callback, |
| 57 const gfx::Image& image); |
| 58 |
| 48 bool IsMetalayerSupported(); | 59 bool IsMetalayerSupported(); |
| 49 void ShowMetalayer(const base::Closure& closed); | 60 void ShowMetalayer(const base::Closure& closed); |
| 50 void HideMetalayer(); | 61 void HideMetalayer(); |
| 51 | 62 |
| 52 // For supporting ArcServiceManager::GetService<T>(). | 63 // For supporting ArcServiceManager::GetService<T>(). |
| 53 static const char kArcServiceName[]; | 64 static const char kArcServiceName[]; |
| 54 | 65 |
| 55 private: | 66 private: |
| 56 void SetMetalayerVisibility(bool visible); | 67 void SetMetalayerVisibility(bool visible); |
| 57 | 68 |
| 58 mojo::Binding<mojom::VoiceInteractionFrameworkHost> binding_; | 69 mojo::Binding<mojom::VoiceInteractionFrameworkHost> binding_; |
| 59 base::Closure metalayer_closed_callback_; | 70 base::Closure metalayer_closed_callback_; |
| 60 bool metalayer_enabled_ = false; | 71 bool metalayer_enabled_ = false; |
| 72 std::unique_ptr<ui::LayerTreeOwner> old_layer_owner_; |
| 61 | 73 |
| 62 DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionFrameworkService); | 74 DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionFrameworkService); |
| 63 }; | 75 }; |
| 64 | 76 |
| 65 } // namespace arc | 77 } // namespace arc |
| 66 #endif // CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_F
RAMEWORK_SERVICE_H_ | 78 #endif // CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_F
RAMEWORK_SERVICE_H_ |
| OLD | NEW |