1 // Copyright 2019 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 CHROMEOS_SERVICES_ASSISTANT_ASSISTANT_MANAGER_SERVICE_DELEGATE_IMPL_H_ 6 #define CHROMEOS_SERVICES_ASSISTANT_ASSISTANT_MANAGER_SERVICE_DELEGATE_IMPL_H_ 7 8 #include <memory> 9 #include <string> 10 11 #include "chromeos/services/assistant/assistant_manager_service_delegate.h" 12 #include "mojo/public/cpp/bindings/pending_remote.h" 13 #include "services/device/public/mojom/battery_monitor.mojom.h" 14 15 namespace chromeos { 16 namespace assistant { 17 18 class ServiceContext; 19 20 class AssistantManagerServiceDelegateImpl 21 : public AssistantManagerServiceDelegate { 22 public: 23 AssistantManagerServiceDelegateImpl( 24 mojo::PendingRemote<device::mojom::BatteryMonitor> battery_monitor, 25 ServiceContext* context); 26 ~AssistantManagerServiceDelegateImpl() override; 27 28 std::unique_ptr<CrosPlatformApi> CreatePlatformApi( 29 AssistantMediaSession* media_session, 30 scoped_refptr<base::SingleThreadTaskRunner> background_thread_task_runner) 31 override; 32 33 std::unique_ptr<assistant_client::AssistantManager> CreateAssistantManager( 34 assistant_client::PlatformApi* platform_api, 35 const std::string& lib_assistant_config) override; 36 37 assistant_client::AssistantManagerInternal* UnwrapAssistantManagerInternal( 38 assistant_client::AssistantManager* assistant_manager) override; 39 40 private: 41 mojo::PendingRemote<device::mojom::BatteryMonitor> battery_monitor_; 42 // Owned by the parent |Service| which will destroy |this| before |context_|. 43 ServiceContext* context_; 44 45 DISALLOW_COPY_AND_ASSIGN(AssistantManagerServiceDelegateImpl); 46 }; 47 48 } // namespace assistant 49 } // namespace chromeos 50 51 #endif // CHROMEOS_SERVICES_ASSISTANT_ASSISTANT_MANAGER_SERVICE_DELEGATE_IMPL_H_ 52