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

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

Issue 10911073: NOT FOR COMMIT: Add DeviceInfo type and ChangeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 8 years, 3 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/device_info.h
diff --git a/chrome/browser/sync/glue/device_info.h b/chrome/browser/sync/glue/device_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..d5125a10bbeb5e59fa8d6c4e8def27116682be25
--- /dev/null
+++ b/chrome/browser/sync/glue/device_info.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 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_DEVICE_INFO_H_
+#define CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_
+
+#include <string>
+#include "base/bind.h"
+#include "sync/protocol/sync.pb.h"
+
+namespace browser_sync {
+
+// A class that holds information regarding the properties of a device.
+//
+// These objects do not contain enough information to uniquely identify devices.
+// Two different devices may end up generating identical DeviceInfos.
+class DeviceInfo {
+ public:
+ DeviceInfo();
+ DeviceInfo(const std::string& client_name,
+ const std::string& chrome_version,
+ const sync_pb::SyncEnums::DeviceType device_type);
+ ~DeviceInfo();
+
+ const std::string& client_name() const;
+ const std::string& chrome_version() const;
+ sync_pb::SyncEnums::DeviceType device_type() const;
+
+ // Compares this objects fields with another.
Nicolas Zea 2012/09/17 17:54:00 "object's", "another's"
rlarocque 2012/09/19 23:03:08 Done. (will be fixed in next upload)
+ bool Equals(const DeviceInfo& other) const;
+
+ static sync_pb::SyncEnums::DeviceType GetLocalDeviceType();
+ static void CreateLocalDeviceInfo(
+ base::Callback<void(const DeviceInfo& local_info)> callback);
+
Nicolas Zea 2012/09/17 17:54:00 remove newline
rlarocque 2012/09/19 23:03:08 Done.
+
Nicolas Zea 2012/09/17 17:54:00 should we expose guid as well? (can be a TODO)
rlarocque 2012/09/19 23:03:08 I left it out intentionally. It's an opaque value
+ private:
+ static void CreateLocalDeviceInfoContinuation(
+ base::Callback<void(const DeviceInfo& local_info)> callback,
+ const std::string& session_name);
+
+ std::string client_name_;
+ std::string chrome_version_;
+ sync_pb::SyncEnums::DeviceType device_type_;
+};
+
+}
+
+#endif // CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698