Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 // Apps can set ids for a device that is meaningful to them but | 71 // Apps can set ids for a device that is meaningful to them but |
| 72 // not unique enough so the user can be tracked. Exposing |guid| | 72 // not unique enough so the user can be tracked. Exposing |guid| |
| 73 // would lead to a stable unique id for a device which can potentially | 73 // would lead to a stable unique id for a device which can potentially |
| 74 // be used for tracking. | 74 // be used for tracking. |
| 75 void set_public_id(std::string id); | 75 void set_public_id(std::string id); |
| 76 | 76 |
| 77 // Converts the |DeviceInfo| values to a JS friendly DictionaryValue, | 77 // Converts the |DeviceInfo| values to a JS friendly DictionaryValue, |
| 78 // which extension APIs can expose to third party apps. | 78 // which extension APIs can expose to third party apps. |
| 79 base::DictionaryValue* ToValue(); | 79 base::DictionaryValue* ToValue(); |
| 80 | 80 |
| 81 // Makes a copy of |DeviceInfo|. | |
| 82 DeviceInfo* Clone() const; | |
|
stanisc
2014/09/16 00:17:40
Would you rather have a copy constructor?
pavely
2014/09/17 23:04:38
Discussed in person.
You can keep Clone, it depend
stanisc
2014/09/18 22:46:53
I decided to get rid of Clone. My next change woul
| |
| 83 | |
| 81 static sync_pb::SyncEnums::DeviceType GetLocalDeviceType(); | 84 static sync_pb::SyncEnums::DeviceType GetLocalDeviceType(); |
| 82 | 85 |
| 83 // Creates a |DeviceInfo| object representing the local device and passes | 86 // Creates a |DeviceInfo| object representing the local device and passes |
| 84 // it as parameter to the callback. | 87 // it as parameter to the callback. |
| 85 static void CreateLocalDeviceInfo( | 88 static void CreateLocalDeviceInfo( |
| 86 const std::string& guid, | 89 const std::string& guid, |
| 87 const std::string& signin_scoped_device_id, | 90 const std::string& signin_scoped_device_id, |
| 88 base::Callback<void(const DeviceInfo& local_info)> callback); | 91 base::Callback<void(const DeviceInfo& local_info)> callback); |
| 89 | 92 |
| 90 // Gets the local device name and passes it as a parameter to callback. | 93 // Gets the local device name and passes it as a parameter to callback. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 // ids in that the same device will have different id for different apps | 128 // ids in that the same device will have different id for different apps |
| 126 // and they are also reset when app/extension is uninstalled. | 129 // and they are also reset when app/extension is uninstalled. |
| 127 std::string public_id_; | 130 std::string public_id_; |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(DeviceInfo); | 132 DISALLOW_COPY_AND_ASSIGN(DeviceInfo); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace browser_sync | 135 } // namespace browser_sync |
| 133 | 136 |
| 134 #endif // CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_ | 137 #endif // CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_H_ |
| OLD | NEW |