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..2899de6ac34606d53031b0cd2b0d5a2edbaca5a0 |
--- /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. |
+ virtual const DeviceInfo* GetLocalDeviceInfo() const OVERRIDE; |
+ |
+ // Used for creation of the machine tag for this local session. |
+ virtual std::string GetLocalSyncCacheGUID() const OVERRIDE; |
+ |
+ // Starts initializing local device info. |
+ virtual void Initialize(const std::string& cache_guid) OVERRIDE; |
+ |
+ // Specifies whether local device info is available |
rlarocque
2014/07/08 18:25:38
Comments should end with a period.
stanisc
2014/07/09 21:58:36
Done.
|
+ virtual bool IsInitialized() const OVERRIDE; |
+ |
+ // Registers a callback to be called when local device info becomes available |
rlarocque
2014/07/08 18:25:38
Add a period here, too.
stanisc
2014/07/09 21:58:36
Done.
|
+ virtual scoped_ptr<Subscription> RegisterOnInitializedCallback( |
+ const base::Closure& callback) OVERRIDE; |
+ |
+ 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_ |