| Index: chrome/browser/sync/glue/device_info.cc
|
| diff --git a/chrome/browser/sync/glue/device_info.cc b/chrome/browser/sync/glue/device_info.cc
|
| index 76033de2758e4eef9a5cd364e10fca0ec7f0c03a..f3ea3602ddef8da4ffd64053a8f20d651f4c4f5f 100644
|
| --- a/chrome/browser/sync/glue/device_info.cc
|
| +++ b/chrome/browser/sync/glue/device_info.cc
|
| @@ -39,7 +39,7 @@ std::string ChannelToString(chrome::VersionInfo::Channel channel) {
|
| default:
|
| NOTREACHED();
|
| return "unknown";
|
| - };
|
| + }
|
| }
|
|
|
| } // namespace
|
| @@ -48,12 +48,14 @@ DeviceInfo::DeviceInfo(const std::string& guid,
|
| const std::string& client_name,
|
| const std::string& chrome_version,
|
| const std::string& sync_user_agent,
|
| - const sync_pb::SyncEnums::DeviceType device_type)
|
| + const sync_pb::SyncEnums::DeviceType device_type,
|
| + const std::string& signin_scoped_device_id)
|
| : guid_(guid),
|
| client_name_(client_name),
|
| chrome_version_(chrome_version),
|
| sync_user_agent_(sync_user_agent),
|
| - device_type_(device_type) {
|
| + device_type_(device_type),
|
| + signin_scoped_device_id_(signin_scoped_device_id) {
|
| }
|
|
|
| DeviceInfo::~DeviceInfo() { }
|
| @@ -82,6 +84,10 @@ sync_pb::SyncEnums::DeviceType DeviceInfo::device_type() const {
|
| return device_type_;
|
| }
|
|
|
| +const std::string& DeviceInfo::signin_scoped_device_id() const {
|
| + return signin_scoped_device_id_;
|
| +}
|
| +
|
| std::string DeviceInfo::GetOSString() const {
|
| switch (device_type_) {
|
| case sync_pb::SyncEnums_DeviceType_TYPE_WIN:
|
| @@ -119,11 +125,12 @@ std::string DeviceInfo::GetDeviceTypeString() const {
|
| }
|
|
|
| bool DeviceInfo::Equals(const DeviceInfo& other) const {
|
| - return this->guid() == other.guid()
|
| - && this->client_name() == other.client_name()
|
| - && this->chrome_version() == other.chrome_version()
|
| - && this->sync_user_agent() == other.sync_user_agent()
|
| - && this->device_type() == other.device_type();
|
| + return this->guid() == other.guid() &&
|
| + this->client_name() == other.client_name() &&
|
| + this->chrome_version() == other.chrome_version() &&
|
| + this->sync_user_agent() == other.sync_user_agent() &&
|
| + this->device_type() == other.device_type() &&
|
| + this->signin_scoped_device_id() == other.signin_scoped_device_id();
|
| }
|
|
|
| // static.
|
| @@ -202,11 +209,12 @@ void DeviceInfo::set_public_id(std::string id) {
|
| // static.
|
| void DeviceInfo::CreateLocalDeviceInfo(
|
| const std::string& guid,
|
| + const std::string& signin_scoped_device_id,
|
| base::Callback<void(const DeviceInfo& local_info)> callback) {
|
| - GetClientName(
|
| - base::Bind(&DeviceInfo::CreateLocalDeviceInfoContinuation,
|
| - guid,
|
| - callback));
|
| + GetClientName(base::Bind(&DeviceInfo::CreateLocalDeviceInfoContinuation,
|
| + guid,
|
| + signin_scoped_device_id,
|
| + callback));
|
| }
|
|
|
| // static.
|
| @@ -227,16 +235,17 @@ void DeviceInfo::GetClientNameContinuation(
|
| // static.
|
| void DeviceInfo::CreateLocalDeviceInfoContinuation(
|
| const std::string& guid,
|
| + const std::string& signin_scoped_device_id,
|
| base::Callback<void(const DeviceInfo& local_info)> callback,
|
| const std::string& session_name) {
|
| chrome::VersionInfo version_info;
|
|
|
| - DeviceInfo local_info(
|
| - guid,
|
| - session_name,
|
| - version_info.CreateVersionString(),
|
| - MakeUserAgentForSyncApi(version_info),
|
| - GetLocalDeviceType());
|
| + DeviceInfo local_info(guid,
|
| + session_name,
|
| + version_info.CreateVersionString(),
|
| + MakeUserAgentForSyncApi(version_info),
|
| + GetLocalDeviceType(),
|
| + signin_scoped_device_id);
|
|
|
| callback.Run(local_info);
|
| }
|
|
|