Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Side by Side Diff: sync/protocol/proto_value_conversions.cc

Issue 10985008: sync: Add DeviceInfo protobuf and supporting code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another missing include Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Keep this file in sync with the .proto files in this directory. 5 // Keep this file in sync with the .proto files in this directory.
6 6
7 #include "sync/protocol/proto_value_conversions.h" 7 #include "sync/protocol/proto_value_conversions.h"
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 SET_STR(username_value); 184 SET_STR(username_value);
185 SET_STR(password_element); 185 SET_STR(password_element);
186 value->SetString("password_value", "<redacted>"); 186 value->SetString("password_value", "<redacted>");
187 SET_BOOL(ssl_valid); 187 SET_BOOL(ssl_valid);
188 SET_BOOL(preferred); 188 SET_BOOL(preferred);
189 SET_INT64(date_created); 189 SET_INT64(date_created);
190 SET_BOOL(blacklisted); 190 SET_BOOL(blacklisted);
191 return value; 191 return value;
192 } 192 }
193 193
194 DictionaryValue* DeviceInformationToValue( 194 DictionaryValue* DeviceInfoSpecificsToValue(
195 const sync_pb::DeviceInformation& proto) { 195 const sync_pb::DeviceInfoSpecifics& proto) {
196 DictionaryValue* value = new DictionaryValue(); 196 DictionaryValue* value = new DictionaryValue();
197 SET_STR(cache_guid); 197 SET_STR(cache_guid);
198 SET_STR(name); 198 SET_STR(client_name);
199 SET_STR(platform); 199 SET_ENUM(device_type, GetDeviceTypeString);
200 SET_STR(sync_user_agent);
200 SET_STR(chrome_version); 201 SET_STR(chrome_version);
201 return value; 202 return value;
202 } 203 }
203 204
204 DictionaryValue* AppNotificationToValue( 205 DictionaryValue* AppNotificationToValue(
205 const sync_pb::AppNotification& proto) { 206 const sync_pb::AppNotification& proto) {
206 DictionaryValue* value = new DictionaryValue(); 207 DictionaryValue* value = new DictionaryValue();
207 SET_STR(guid); 208 SET_STR(guid);
208 SET_STR(app_id); 209 SET_STR(app_id);
209 SET_INT64(creation_timestamp_ms); 210 SET_INT64(creation_timestamp_ms);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 SET_BOOL(encrypt_autofill); 307 SET_BOOL(encrypt_autofill);
307 SET_BOOL(encrypt_themes); 308 SET_BOOL(encrypt_themes);
308 SET_BOOL(encrypt_typed_urls); 309 SET_BOOL(encrypt_typed_urls);
309 SET_BOOL(encrypt_extension_settings); 310 SET_BOOL(encrypt_extension_settings);
310 SET_BOOL(encrypt_extensions); 311 SET_BOOL(encrypt_extensions);
311 SET_BOOL(encrypt_sessions); 312 SET_BOOL(encrypt_sessions);
312 SET_BOOL(encrypt_app_settings); 313 SET_BOOL(encrypt_app_settings);
313 SET_BOOL(encrypt_apps); 314 SET_BOOL(encrypt_apps);
314 SET_BOOL(encrypt_search_engines); 315 SET_BOOL(encrypt_search_engines);
315 SET_BOOL(encrypt_everything); 316 SET_BOOL(encrypt_everything);
316 SET_REP(device_information, DeviceInformationToValue);
317 SET_BOOL(sync_tab_favicons); 317 SET_BOOL(sync_tab_favicons);
318 SET_ENUM(passphrase_type, PassphraseTypeString); 318 SET_ENUM(passphrase_type, PassphraseTypeString);
319 SET(keystore_decryptor_token, EncryptedDataToValue); 319 SET(keystore_decryptor_token, EncryptedDataToValue);
320 SET_INT64(keystore_migration_time); 320 SET_INT64(keystore_migration_time);
321 return value; 321 return value;
322 } 322 }
323 323
324 DictionaryValue* PasswordSpecificsToValue( 324 DictionaryValue* PasswordSpecificsToValue(
325 const sync_pb::PasswordSpecifics& proto) { 325 const sync_pb::PasswordSpecifics& proto) {
326 DictionaryValue* value = new DictionaryValue(); 326 DictionaryValue* value = new DictionaryValue();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 391
392 DictionaryValue* EntitySpecificsToValue( 392 DictionaryValue* EntitySpecificsToValue(
393 const sync_pb::EntitySpecifics& specifics) { 393 const sync_pb::EntitySpecifics& specifics) {
394 DictionaryValue* value = new DictionaryValue(); 394 DictionaryValue* value = new DictionaryValue();
395 SET_FIELD(app, AppSpecificsToValue); 395 SET_FIELD(app, AppSpecificsToValue);
396 SET_FIELD(app_notification, AppNotificationToValue); 396 SET_FIELD(app_notification, AppNotificationToValue);
397 SET_FIELD(app_setting, AppSettingSpecificsToValue); 397 SET_FIELD(app_setting, AppSettingSpecificsToValue);
398 SET_FIELD(autofill, AutofillSpecificsToValue); 398 SET_FIELD(autofill, AutofillSpecificsToValue);
399 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); 399 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue);
400 SET_FIELD(bookmark, BookmarkSpecificsToValue); 400 SET_FIELD(bookmark, BookmarkSpecificsToValue);
401 SET_FIELD(device_info, DeviceInfoSpecificsToValue);
401 SET_FIELD(extension, ExtensionSpecificsToValue); 402 SET_FIELD(extension, ExtensionSpecificsToValue);
402 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); 403 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue);
403 SET_FIELD(nigori, NigoriSpecificsToValue); 404 SET_FIELD(nigori, NigoriSpecificsToValue);
404 SET_FIELD(password, PasswordSpecificsToValue); 405 SET_FIELD(password, PasswordSpecificsToValue);
405 SET_FIELD(preference, PreferenceSpecificsToValue); 406 SET_FIELD(preference, PreferenceSpecificsToValue);
406 SET_FIELD(search_engine, SearchEngineSpecificsToValue); 407 SET_FIELD(search_engine, SearchEngineSpecificsToValue);
407 SET_FIELD(session, SessionSpecificsToValue); 408 SET_FIELD(session, SessionSpecificsToValue);
408 SET_FIELD(theme, ThemeSpecificsToValue); 409 SET_FIELD(theme, ThemeSpecificsToValue);
409 SET_FIELD(typed_url, TypedUrlSpecificsToValue); 410 SET_FIELD(typed_url, TypedUrlSpecificsToValue);
410 return value; 411 return value;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 #undef SET_BYTES 595 #undef SET_BYTES
595 #undef SET_INT32 596 #undef SET_INT32
596 #undef SET_INT64 597 #undef SET_INT64
597 #undef SET_INT64_REP 598 #undef SET_INT64_REP
598 #undef SET_STR 599 #undef SET_STR
599 #undef SET_STR_REP 600 #undef SET_STR_REP
600 601
601 #undef SET_FIELD 602 #undef SET_FIELD
602 603
603 } // namespace syncer 604 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/protocol/proto_value_conversions.h ('k') | sync/protocol/proto_value_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698