Index: chrome/browser/sync/glue/local_device_info_provider_impl.h |
diff --git a/chrome/browser/sync/glue/local_device_info_provider_impl.h b/chrome/browser/sync/glue/local_device_info_provider_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4da576fdcd2d36a92f0e769e77ac0fe032395083 |
--- /dev/null |
+++ b/chrome/browser/sync/glue/local_device_info_provider_impl.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2014 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_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
+#define CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "chrome/browser/sync/glue/device_info.h" |
+#include "chrome/browser/sync/glue/local_device_info_provider.h" |
+ |
+namespace browser_sync { |
+ |
+class LocalDeviceInfoProviderImpl : public LocalDeviceInfoProvider { |
+ public: |
+ LocalDeviceInfoProviderImpl(); |
+ virtual ~LocalDeviceInfoProviderImpl(); |
+ |
+ // Returns sync's representation of the local device info. |
+ // Return value is an empty scoped_ptr if the device info is unavailable. |
maniscalco
2014/07/08 21:17:53
Since these methods are documented in the base cla
stanisc
2014/07/09 21:58:36
Done.
|
+ virtual const DeviceInfo* GetLocalDeviceInfo() const OVERRIDE; |
+ |
+ // Used for creation of the machine tag for this local session. |
+ virtual std::string GetLocalSyncCacheGUID() const OVERRIDE; |
+ |
+ // Specifies whether local device info is available |
+ virtual bool IsInitialized() const OVERRIDE; |
+ |
+ // Registers a callback to be called when local device info becomes available |
+ virtual scoped_ptr<Subscription> RegisterOnInitializedCallback( |
+ const base::Closure& callback) OVERRIDE; |
+ |
+ // Starts initializing local device info |
+ void Initialize(const std::string& cache_guid); |
+ |
+ private: |
+ void InitializeContinuation(const DeviceInfo& local_info); |
+ |
+ std::string cache_guid_; |
+ scoped_ptr<DeviceInfo> local_device_info_; |
+ base::CallbackList<void(void)> callback_list_; |
+ base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(LocalDeviceInfoProviderImpl); |
+}; |
+ |
+} // namespace browser_sync |
+ |
+#endif // CHROME_BROWSER_SYNC_GLUE_LOCAL_DEVICE_INFO_PROVIDER_IMPL_H_ |