1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_ASH_COMPONENTS_SYNC_WIFI_WIFI_CONFIGURATION_SYNC_SERVICE_H_
#define CHROMEOS_ASH_COMPONENTS_SYNC_WIFI_WIFI_CONFIGURATION_SYNC_SERVICE_H_
#include <memory>
#include <string>
#include "base/memory/weak_ptr.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/prefs/pref_service.h"
#include "components/sync/model/data_type_store.h"
#include "components/sync/model/data_type_store_service.h"
#include "components/version_info/channel.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace syncer {
class DataTypeControllerDelegate;
} // namespace syncer
namespace ash::timer_factory {
class TimerFactory;
} // namespace ash::timer_factory
namespace ash {
class NetworkMetadataStore;
namespace sync_wifi {
class LocalNetworkCollectorImpl;
class SyncedNetworkUpdaterImpl;
class WifiConfigurationBridge;
class SyncedNetworkMetricsLogger;
// A profile keyed service which instantiates and provides access to an instance
// of WifiConfigurationBridge.
class WifiConfigurationSyncService : public KeyedService {
public:
WifiConfigurationSyncService(
version_info::Channel channel,
PrefService* pref_service,
syncer::OnceDataTypeStoreFactory create_store_callback);
WifiConfigurationSyncService(const WifiConfigurationSyncService&) = delete;
WifiConfigurationSyncService& operator=(const WifiConfigurationSyncService&) =
delete;
~WifiConfigurationSyncService() override;
base::WeakPtr<syncer::DataTypeControllerDelegate> GetControllerDelegate();
void SetNetworkMetadataStore(
base::WeakPtr<NetworkMetadataStore> network_metadata_store);
private:
mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig>
remote_cros_network_config_;
std::unique_ptr<SyncedNetworkMetricsLogger> metrics_logger_;
std::unique_ptr<ash::timer_factory::TimerFactory> timer_factory_;
std::unique_ptr<SyncedNetworkUpdaterImpl> updater_;
std::unique_ptr<LocalNetworkCollectorImpl> collector_;
std::unique_ptr<WifiConfigurationBridge> bridge_;
};
} // namespace sync_wifi
} // namespace ash
#endif // CHROMEOS_ASH_COMPONENTS_SYNC_WIFI_WIFI_CONFIGURATION_SYNC_SERVICE_H_
|