Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / local_device_info_provider_impl.h
index 752a663..7b91fc4 100644 (file)
@@ -6,18 +6,23 @@
 #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"
+#include "components/sync_driver/device_info.h"
+#include "components/sync_driver/local_device_info_provider.h"
+
+namespace chrome {
+class VersionInfo;
+}
 
 namespace browser_sync {
 
-class LocalDeviceInfoProviderImpl : public LocalDeviceInfoProvider {
+class LocalDeviceInfoProviderImpl
+    : public sync_driver::LocalDeviceInfoProvider {
  public:
   LocalDeviceInfoProviderImpl();
   virtual ~LocalDeviceInfoProviderImpl();
 
   // LocalDeviceInfoProvider implementation.
-  virtual const DeviceInfo* GetLocalDeviceInfo() const OVERRIDE;
+  virtual const sync_driver::DeviceInfo* GetLocalDeviceInfo() const OVERRIDE;
   virtual std::string GetLocalSyncCacheGUID() const OVERRIDE;
   virtual void Initialize(
       const std::string& cache_guid,
@@ -25,11 +30,19 @@ class LocalDeviceInfoProviderImpl : public LocalDeviceInfoProvider {
   virtual scoped_ptr<Subscription> RegisterOnInitializedCallback(
     const base::Closure& callback) OVERRIDE;
 
+  // Helper to construct a user agent string (ASCII) suitable for use by
+  // the syncapi for any HTTP communication. This string is used by the sync
+  // backend for classifying client types when calculating statistics.
+  static std::string MakeUserAgentForSyncApi(
+      const chrome::VersionInfo& version_info);
+
  private:
-  void InitializeContinuation(const DeviceInfo& local_info);
+  void InitializeContinuation(const std::string& guid,
+                              const std::string& signin_scoped_device_id,
+                              const std::string& session_name);
 
   std::string cache_guid_;
-  scoped_ptr<DeviceInfo> local_device_info_;
+  scoped_ptr<sync_driver::DeviceInfo> local_device_info_;
   base::CallbackList<void(void)> callback_list_;
   base::WeakPtrFactory<LocalDeviceInfoProviderImpl> weak_factory_;