Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: chrome/browser/sync/glue/local_device_info_provider_impl.h

Issue 367153005: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed build issues in browser_tests Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698