diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-08-23 16:39:15 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-08-23 16:39:15 +0100 |
commit | 3551c9c881056c480085172ff9840cab31610854 (patch) | |
tree | 23660320f5f4c279966609cf9da7491b96d10ca8 /chrome/browser/sync/glue | |
parent | 4e9d9adbbb6cf287125ca44a0823791a570472f5 (diff) | |
download | chromium_org-3551c9c881056c480085172ff9840cab31610854.tar.gz |
Merge from Chromium at DEPS revision r219274
This commit was generated by merge_to_master.py.
Change-Id: Ibb7f41396cadf4071e89153e1913c986d126f65d
Diffstat (limited to 'chrome/browser/sync/glue')
-rw-r--r-- | chrome/browser/sync/glue/device_info.cc | 42 | ||||
-rw-r--r-- | chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc | 4 |
2 files changed, 30 insertions, 16 deletions
diff --git a/chrome/browser/sync/glue/device_info.cc b/chrome/browser/sync/glue/device_info.cc index 486c8bb5e2..dc2119032a 100644 --- a/chrome/browser/sync/glue/device_info.cc +++ b/chrome/browser/sync/glue/device_info.cc @@ -44,22 +44,36 @@ std::string ChannelToString(chrome::VersionInfo::Channel channel) { std::string DeviceTypeToString(sync_pb::SyncEnums::DeviceType device_type) { switch (device_type) { case sync_pb::SyncEnums_DeviceType_TYPE_WIN: - return "WIN"; case sync_pb::SyncEnums_DeviceType_TYPE_MAC: - return "MAC"; case sync_pb::SyncEnums_DeviceType_TYPE_LINUX: - return "LINUX"; case sync_pb::SyncEnums_DeviceType_TYPE_CROS: - return "CHROME OS"; - case sync_pb::SyncEnums_DeviceType_TYPE_OTHER: - return "OTHER"; + return "desktop_or_laptop"; case sync_pb::SyncEnums_DeviceType_TYPE_PHONE: - return "PHONE"; + return "phone"; case sync_pb::SyncEnums_DeviceType_TYPE_TABLET: - return "TABLET"; + return "tablet"; default: - NOTREACHED(); - return "UNKNOWN"; + return "unknown"; + } +} + +std::string GetOS(sync_pb::SyncEnums::DeviceType device_type) { + switch (device_type) { + case sync_pb::SyncEnums_DeviceType_TYPE_WIN: + return "win"; + case sync_pb::SyncEnums_DeviceType_TYPE_MAC: + return "mac"; + case sync_pb::SyncEnums_DeviceType_TYPE_LINUX: + return "linux"; + case sync_pb::SyncEnums_DeviceType_TYPE_CROS: + return "chrome_os"; + case sync_pb::SyncEnums_DeviceType_TYPE_PHONE: + case sync_pb::SyncEnums_DeviceType_TYPE_TABLET: + // TODO(lipalani): crbug.com/170375. Add support for ios + // phones and tablets. + return "android"; + default: + return "unknown"; } } @@ -172,10 +186,10 @@ std::string DeviceInfo::MakeUserAgentForSyncApi( base::DictionaryValue* DeviceInfo::ToValue() { base::DictionaryValue* value = new base::DictionaryValue(); - value->SetString("Id", public_id_); - value->SetString("Client Name", client_name_); - value->SetString("Chrome Version", chrome_version_); - value->SetString("Sync User Agent", sync_user_agent_); + value->SetString("id", public_id_); + value->SetString("name", client_name_); + value->SetString("chromeVersion", chrome_version_); + value->SetString("os", GetOS(device_type_)); value->SetString("Device Type", DeviceTypeToString(device_type_)); return value; } diff --git a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc index bfeeb211d9..3f17c4b5bb 100644 --- a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc @@ -12,9 +12,9 @@ #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread.h" +#include "extensions/common/manifest_constants.h" #include "sync/util/extensions_activity.h" #include "testing/gtest/include/gtest/gtest.h" @@ -25,7 +25,7 @@ namespace browser_sync { namespace { using content::BrowserThread; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; // Create and return an extension with the given path. scoped_refptr<Extension> MakeExtension(const std::string& name) { |