OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_H_ |
6 #define COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_list.h" | 11 #include "base/callback_list.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class TaskRunner; | 14 class TaskRunner; |
15 } | 15 } |
16 | 16 |
17 namespace syncer { | 17 namespace syncer { |
18 | 18 |
19 class DeviceInfo; | 19 class DeviceInfo; |
20 | 20 |
21 // Interface for providing sync specific information about the | 21 // Interface for providing sync specific information about the |
22 // local device. | 22 // local device. |
23 class LocalDeviceInfoProvider { | 23 class LocalDeviceInfoProvider { |
24 public: | 24 public: |
25 typedef base::CallbackList<void(void)>::Subscription Subscription; | 25 using Subscription = base::CallbackList<void(void)>::Subscription; |
26 | 26 |
27 virtual ~LocalDeviceInfoProvider() {} | 27 virtual ~LocalDeviceInfoProvider() {} |
28 | 28 |
29 // Returns sync's representation of the local device info, or nullptr if the | 29 // Returns sync's representation of the local device info, or nullptr if the |
30 // device info is unavailable. The returned object is fully owned by | 30 // device info is unavailable. The returned object is fully owned by |
31 // LocalDeviceInfoProvider; it must not be freed by the caller and should not | 31 // LocalDeviceInfoProvider; it must not be freed by the caller and should not |
32 // be stored. | 32 // be stored. |
33 virtual const DeviceInfo* GetLocalDeviceInfo() const = 0; | 33 virtual const DeviceInfo* GetLocalDeviceInfo() const = 0; |
34 | 34 |
35 // Constructs a user agent string (ASCII) suitable for use by the syncapi | 35 // Constructs a user agent string (ASCII) suitable for use by the syncapi |
(...skipping 19 matching lines...) Expand all Loading... |
55 virtual std::unique_ptr<Subscription> RegisterOnInitializedCallback( | 55 virtual std::unique_ptr<Subscription> RegisterOnInitializedCallback( |
56 const base::Closure& callback) = 0; | 56 const base::Closure& callback) = 0; |
57 | 57 |
58 // Clears all cached data, returning to an uninitialized state. | 58 // Clears all cached data, returning to an uninitialized state. |
59 virtual void Clear() = 0; | 59 virtual void Clear() = 0; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace syncer | 62 } // namespace syncer |
63 | 63 |
64 #endif // COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_H_ | 64 #endif // COMPONENTS_SYNC_DEVICE_INFO_LOCAL_DEVICE_INFO_PROVIDER_H_ |
OLD | NEW |