blob: d676c8a562419e862034b711dc83ab2d76d748c5 [file] [log] [blame]
Kyle Horimotoa75542612018-04-18 00:33:391// 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 COMPONENTS_CRYPTAUTH_SOFTWARE_FEATURE_MANAGER_H_
6#define COMPONENTS_CRYPTAUTH_SOFTWARE_FEATURE_MANAGER_H_
7
8#include "base/callback.h"
9#include "components/cryptauth/proto/cryptauth_api.pb.h"
10
11namespace cryptauth {
12
13// Queries for eligible MultiDevice hosts and sets/changes/unsets the current
14// MultiDevice host for the logged-in account.
15class SoftwareFeatureManager {
16 public:
17 virtual ~SoftwareFeatureManager() {}
18
19 // Enables or disables |software_feature| for the device with public key
20 // |public_key|. If |enabled| and |is_exclusive| are both true, then all other
21 // devices associated with this account will have |sofware_feature| disabled.
22 // |is_exclusive| is ignored if |enabled| is false.
23 virtual void SetSoftwareFeatureState(
24 const std::string& public_key,
25 SoftwareFeature software_feature,
26 bool enabled,
27 const base::Closure& success_callback,
28 const base::Callback<void(const std::string&)>& error_callback,
29 bool is_exclusive = false) = 0;
30
31 // Finds eligible devices associated with the logged-in account which support
32 // |software_feature|.
33 virtual void FindEligibleDevices(
34 SoftwareFeature software_feature,
35 const base::Callback<void(const std::vector<ExternalDeviceInfo>&,
36 const std::vector<IneligibleDevice>&)>&
37 success_callback,
38 const base::Callback<void(const std::string&)>& error_callback) = 0;
39};
40
41} // namespace cryptauth
42
43#endif // COMPONENTS_CRYPTAUTH_SOFTWARE_FEATURE_MANAGER_H_