Revert of Add Masonry to key_silk_cases. (patchset #3 id:40001 of https://codereview...
[chromium-blink-merge.git] / components / sync_driver / local_device_info_provider.h
blob6036a7e7b8ec0ea19c2b0fc70e63690b4a538de3
1 // Copyright 2014 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.
5 #ifndef COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_H_
6 #define COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_H_
8 #include <string>
9 #include "base/callback_list.h"
11 namespace sync_driver {
13 class DeviceInfo;
15 // Interface for providing sync specific informaiton about the
16 // local device.
17 class LocalDeviceInfoProvider {
18 public:
19 typedef base::CallbackList<void(void)>::Subscription Subscription;
21 virtual ~LocalDeviceInfoProvider() {}
23 // Returns sync's representation of the local device info;
24 // NULL if the device info is unavailable.
25 // The returned object is fully owned by LocalDeviceInfoProvider (must not
26 // be freed by the caller). It remains valid until LocalDeviceInfoProvider
27 // is destroyed.
28 virtual const DeviceInfo* GetLocalDeviceInfo() const = 0;
30 // Returns a GUID string used for creation of the machine tag for
31 // this local session; an empty sting if LocalDeviceInfoProvider hasn't been
32 // initialized yet.
33 virtual std::string GetLocalSyncCacheGUID() const = 0;
35 // Starts initializing local device info.
36 virtual void Initialize(
37 const std::string& cache_guid,
38 const std::string& signin_scoped_device_id) = 0;
40 // Registers a callback to be called when local device info becomes available.
41 // The callback will remain registered until the
42 // returned Subscription is destroyed, which must occur before the
43 // CallbackList is destroyed.
44 virtual scoped_ptr<Subscription> RegisterOnInitializedCallback(
45 const base::Closure& callback) = 0;
48 } // namespace sync_driver
50 #endif // COMPONENTS_SYNC_DRIVER_LOCAL_DEVICE_INFO_PROVIDER_H_