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

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: Created 8 years, 3 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 SET_STR(username_value); 179 SET_STR(username_value);
180 SET_STR(password_element); 180 SET_STR(password_element);
181 value->SetString("password_value", "<redacted>"); 181 value->SetString("password_value", "<redacted>");
182 SET_BOOL(ssl_valid); 182 SET_BOOL(ssl_valid);
183 SET_BOOL(preferred); 183 SET_BOOL(preferred);
184 SET_INT64(date_created); 184 SET_INT64(date_created);
185 SET_BOOL(blacklisted); 185 SET_BOOL(blacklisted);
186 return value; 186 return value;
187 } 187 }
188 188
189 DictionaryValue* DeviceInformationToValue( 189 DictionaryValue* DeviceInfoSpecificsToValue(
190 const sync_pb::DeviceInformation& proto) { 190 const sync_pb::DeviceInfoSpecifics& proto) {
191 DictionaryValue* value = new DictionaryValue(); 191 DictionaryValue* value = new DictionaryValue();
192 SET_STR(cache_guid); 192 SET_STR(cache_guid);
193 SET_STR(name); 193 SET_STR(client_name);
194 SET_STR(platform); 194 SET_ENUM(device_type, GetDeviceTypeString);
195 SET_STR(chrome_version); 195 SET_STR(sync_user_agent);
196 return value; 196 return value;
197 } 197 }
198 198
199 DictionaryValue* AppNotificationToValue( 199 DictionaryValue* AppNotificationToValue(
200 const sync_pb::AppNotification& proto) { 200 const sync_pb::AppNotification& proto) {
201 DictionaryValue* value = new DictionaryValue(); 201 DictionaryValue* value = new DictionaryValue();
202 SET_STR(guid); 202 SET_STR(guid);
203 SET_STR(app_id); 203 SET_STR(app_id);
204 SET_INT64(creation_timestamp_ms); 204 SET_INT64(creation_timestamp_ms);
205 SET_STR(title); 205 SET_STR(title);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 SET_BOOL(encrypt_autofill); 301 SET_BOOL(encrypt_autofill);
302 SET_BOOL(encrypt_themes); 302 SET_BOOL(encrypt_themes);
303 SET_BOOL(encrypt_typed_urls); 303 SET_BOOL(encrypt_typed_urls);
304 SET_BOOL(encrypt_extension_settings); 304 SET_BOOL(encrypt_extension_settings);
305 SET_BOOL(encrypt_extensions); 305 SET_BOOL(encrypt_extensions);
306 SET_BOOL(encrypt_sessions); 306 SET_BOOL(encrypt_sessions);
307 SET_BOOL(encrypt_app_settings); 307 SET_BOOL(encrypt_app_settings);
308 SET_BOOL(encrypt_apps); 308 SET_BOOL(encrypt_apps);
309 SET_BOOL(encrypt_search_engines); 309 SET_BOOL(encrypt_search_engines);
310 SET_BOOL(encrypt_everything); 310 SET_BOOL(encrypt_everything);
311 SET_REP(device_information, DeviceInformationToValue);
312 SET_BOOL(sync_tab_favicons); 311 SET_BOOL(sync_tab_favicons);
313 SET_ENUM(passphrase_type, PassphraseTypeString); 312 SET_ENUM(passphrase_type, PassphraseTypeString);
314 SET(keystore_decryptor_token, EncryptedDataToValue); 313 SET(keystore_decryptor_token, EncryptedDataToValue);
315 SET_INT64(keystore_migration_time); 314 SET_INT64(keystore_migration_time);
316 return value; 315 return value;
317 } 316 }
318 317
319 DictionaryValue* PasswordSpecificsToValue( 318 DictionaryValue* PasswordSpecificsToValue(
320 const sync_pb::PasswordSpecifics& proto) { 319 const sync_pb::PasswordSpecifics& proto) {
321 DictionaryValue* value = new DictionaryValue(); 320 DictionaryValue* value = new DictionaryValue();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 385
387 DictionaryValue* EntitySpecificsToValue( 386 DictionaryValue* EntitySpecificsToValue(
388 const sync_pb::EntitySpecifics& specifics) { 387 const sync_pb::EntitySpecifics& specifics) {
389 DictionaryValue* value = new DictionaryValue(); 388 DictionaryValue* value = new DictionaryValue();
390 SET_FIELD(app, AppSpecificsToValue); 389 SET_FIELD(app, AppSpecificsToValue);
391 SET_FIELD(app_notification, AppNotificationToValue); 390 SET_FIELD(app_notification, AppNotificationToValue);
392 SET_FIELD(app_setting, AppSettingSpecificsToValue); 391 SET_FIELD(app_setting, AppSettingSpecificsToValue);
393 SET_FIELD(autofill, AutofillSpecificsToValue); 392 SET_FIELD(autofill, AutofillSpecificsToValue);
394 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); 393 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue);
395 SET_FIELD(bookmark, BookmarkSpecificsToValue); 394 SET_FIELD(bookmark, BookmarkSpecificsToValue);
395 SET_FIELD(device_info, DeviceInfoSpecificsToValue);
396 SET_FIELD(extension, ExtensionSpecificsToValue); 396 SET_FIELD(extension, ExtensionSpecificsToValue);
397 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); 397 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue);
398 SET_FIELD(nigori, NigoriSpecificsToValue); 398 SET_FIELD(nigori, NigoriSpecificsToValue);
399 SET_FIELD(password, PasswordSpecificsToValue); 399 SET_FIELD(password, PasswordSpecificsToValue);
400 SET_FIELD(preference, PreferenceSpecificsToValue); 400 SET_FIELD(preference, PreferenceSpecificsToValue);
401 SET_FIELD(search_engine, SearchEngineSpecificsToValue); 401 SET_FIELD(search_engine, SearchEngineSpecificsToValue);
402 SET_FIELD(session, SessionSpecificsToValue); 402 SET_FIELD(session, SessionSpecificsToValue);
403 SET_FIELD(theme, ThemeSpecificsToValue); 403 SET_FIELD(theme, ThemeSpecificsToValue);
404 SET_FIELD(typed_url, TypedUrlSpecificsToValue); 404 SET_FIELD(typed_url, TypedUrlSpecificsToValue);
405 return value; 405 return value;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 #undef SET_BYTES 589 #undef SET_BYTES
590 #undef SET_INT32 590 #undef SET_INT32
591 #undef SET_INT64 591 #undef SET_INT64
592 #undef SET_INT64_REP 592 #undef SET_INT64_REP
593 #undef SET_STR 593 #undef SET_STR
594 #undef SET_STR_REP 594 #undef SET_STR_REP
595 595
596 #undef SET_FIELD 596 #undef SET_FIELD
597 597
598 } // namespace syncer 598 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698