OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/sync/device_info/device_info.h" | 5 #include "components/sync/device_info/device_info.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 | 8 |
9 namespace sync_driver { | 9 namespace sync_driver { |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 bool DeviceInfo::Equals(const DeviceInfo& other) const { | 90 bool DeviceInfo::Equals(const DeviceInfo& other) const { |
91 return this->guid() == other.guid() && | 91 return this->guid() == other.guid() && |
92 this->client_name() == other.client_name() && | 92 this->client_name() == other.client_name() && |
93 this->chrome_version() == other.chrome_version() && | 93 this->chrome_version() == other.chrome_version() && |
94 this->sync_user_agent() == other.sync_user_agent() && | 94 this->sync_user_agent() == other.sync_user_agent() && |
95 this->device_type() == other.device_type() && | 95 this->device_type() == other.device_type() && |
96 this->signin_scoped_device_id() == other.signin_scoped_device_id(); | 96 this->signin_scoped_device_id() == other.signin_scoped_device_id(); |
97 } | 97 } |
98 | 98 |
99 base::DictionaryValue* DeviceInfo::ToValue() { | 99 std::unique_ptr<base::DictionaryValue> DeviceInfo::ToValue() { |
100 base::DictionaryValue* value = new base::DictionaryValue(); | 100 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
101 value->SetString("name", client_name_); | 101 value->SetString("name", client_name_); |
102 value->SetString("id", public_id_); | 102 value->SetString("id", public_id_); |
103 value->SetString("os", GetOSString()); | 103 value->SetString("os", GetOSString()); |
104 value->SetString("type", GetDeviceTypeString()); | 104 value->SetString("type", GetDeviceTypeString()); |
105 value->SetString("chromeVersion", chrome_version_); | 105 value->SetString("chromeVersion", chrome_version_); |
106 return value; | 106 return value; |
107 } | 107 } |
108 | 108 |
109 void DeviceInfo::set_public_id(const std::string& id) { | 109 void DeviceInfo::set_public_id(const std::string& id) { |
110 public_id_ = id; | 110 public_id_ = id; |
111 } | 111 } |
112 | 112 |
113 } // namespace sync_driver | 113 } // namespace sync_driver |
OLD | NEW |