blob: d0c05f75557b045dbb0478214b735ff5d1eb5471 [file] [log] [blame]
// Copyright 2019 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_UI_ASH_ASSISTANT_ASSISTANT_SERVICE_CONNECTION_H_
#define CHROME_BROWSER_UI_ASH_ASSISTANT_ASSISTANT_SERVICE_CONNECTION_H_
#include "base/macros.h"
#include "base/supports_user_data.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/services/assistant/public/mojom/assistant.mojom.h"
#include "chromeos/services/assistant/service.h"
// AssistantServiceConnection exposes a Mojo interface connection to a Profile's
// own instance of the in-process Assistant service.
class AssistantServiceConnection : public base::SupportsUserData::Data {
public:
explicit AssistantServiceConnection(Profile* profile);
~AssistantServiceConnection() override;
static AssistantServiceConnection* GetForProfile(Profile* profile);
chromeos::assistant::mojom::AssistantService* service() const {
return remote_.get();
}
private:
mojo::Remote<chromeos::assistant::mojom::AssistantService> remote_;
chromeos::assistant::Service service_;
DISALLOW_COPY_AND_ASSIGN(AssistantServiceConnection);
};
#endif // CHROME_BROWSER_UI_ASH_ASSISTANT_ASSISTANT_SERVICE_CONNECTION_H_