| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/protocol/proto_value_conversions.h" | 7 #include "chrome/browser/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" | 
| 11 #include "base/logging.h" | 11 #include "base/logging.h" | 
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" | 
| 13 #include "base/values.h" | 13 #include "base/values.h" | 
| 14 #include "chrome/browser/sync/protocol/app_specifics.pb.h" | 14 #include "chrome/browser/sync/protocol/app_specifics.pb.h" | 
| 15 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" | 15 #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" | 
| 16 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 16 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 
| 17 #include "chrome/browser/sync/protocol/encryption.pb.h" | 17 #include "chrome/browser/sync/protocol/encryption.pb.h" | 
|  | 18 #include "chrome/browser/sync/protocol/extension_setting_specifics.pb.h" | 
| 18 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" | 19 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" | 
| 19 #include "chrome/browser/sync/protocol/nigori_specifics.pb.h" | 20 #include "chrome/browser/sync/protocol/nigori_specifics.pb.h" | 
| 20 #include "chrome/browser/sync/protocol/password_specifics.pb.h" | 21 #include "chrome/browser/sync/protocol/password_specifics.pb.h" | 
| 21 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" | 22 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" | 
| 22 #include "chrome/browser/sync/protocol/proto_enum_conversions.h" | 23 #include "chrome/browser/sync/protocol/proto_enum_conversions.h" | 
| 23 #include "chrome/browser/sync/protocol/search_engine_specifics.pb.h" | 24 #include "chrome/browser/sync/protocol/search_engine_specifics.pb.h" | 
| 24 #include "chrome/browser/sync/protocol/session_specifics.pb.h" | 25 #include "chrome/browser/sync/protocol/session_specifics.pb.h" | 
| 25 #include "chrome/browser/sync/protocol/sync.pb.h" | 26 #include "chrome/browser/sync/protocol/sync.pb.h" | 
| 26 #include "chrome/browser/sync/protocol/theme_specifics.pb.h" | 27 #include "chrome/browser/sync/protocol/theme_specifics.pb.h" | 
| 27 #include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" | 28 #include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 204 | 205 | 
| 205 DictionaryValue* BookmarkSpecificsToValue( | 206 DictionaryValue* BookmarkSpecificsToValue( | 
| 206     const sync_pb::BookmarkSpecifics& proto) { | 207     const sync_pb::BookmarkSpecifics& proto) { | 
| 207   DictionaryValue* value = new DictionaryValue(); | 208   DictionaryValue* value = new DictionaryValue(); | 
| 208   SET_STR(url); | 209   SET_STR(url); | 
| 209   SET_BYTES(favicon); | 210   SET_BYTES(favicon); | 
| 210   SET_STR(title); | 211   SET_STR(title); | 
| 211   return value; | 212   return value; | 
| 212 } | 213 } | 
| 213 | 214 | 
|  | 215 DictionaryValue* ExtensionSettingSpecificsToValue( | 
|  | 216     const sync_pb::ExtensionSettingSpecifics& proto) { | 
|  | 217   DictionaryValue* value = new DictionaryValue(); | 
|  | 218   SET_STR(extension_id); | 
|  | 219   SET_STR(key); | 
|  | 220   SET_STR(value); | 
|  | 221   return value; | 
|  | 222 } | 
|  | 223 | 
| 214 DictionaryValue* ExtensionSpecificsToValue( | 224 DictionaryValue* ExtensionSpecificsToValue( | 
| 215     const sync_pb::ExtensionSpecifics& proto) { | 225     const sync_pb::ExtensionSpecifics& proto) { | 
| 216   DictionaryValue* value = new DictionaryValue(); | 226   DictionaryValue* value = new DictionaryValue(); | 
| 217   SET_STR(id); | 227   SET_STR(id); | 
| 218   SET_STR(version); | 228   SET_STR(version); | 
| 219   SET_STR(update_url); | 229   SET_STR(update_url); | 
| 220   SET_BOOL(enabled); | 230   SET_BOOL(enabled); | 
| 221   SET_BOOL(incognito_enabled); | 231   SET_BOOL(incognito_enabled); | 
| 222   SET_STR(name); | 232   SET_STR(name); | 
| 223   return value; | 233   return value; | 
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 312 } | 322 } | 
| 313 | 323 | 
| 314 DictionaryValue* EntitySpecificsToValue( | 324 DictionaryValue* EntitySpecificsToValue( | 
| 315     const sync_pb::EntitySpecifics& specifics) { | 325     const sync_pb::EntitySpecifics& specifics) { | 
| 316   DictionaryValue* value = new DictionaryValue(); | 326   DictionaryValue* value = new DictionaryValue(); | 
| 317   SET_EXTENSION(sync_pb, app, AppSpecificsToValue); | 327   SET_EXTENSION(sync_pb, app, AppSpecificsToValue); | 
| 318   SET_EXTENSION(sync_pb, autofill, AutofillSpecificsToValue); | 328   SET_EXTENSION(sync_pb, autofill, AutofillSpecificsToValue); | 
| 319   SET_EXTENSION(sync_pb, autofill_profile, AutofillProfileSpecificsToValue); | 329   SET_EXTENSION(sync_pb, autofill_profile, AutofillProfileSpecificsToValue); | 
| 320   SET_EXTENSION(sync_pb, bookmark, BookmarkSpecificsToValue); | 330   SET_EXTENSION(sync_pb, bookmark, BookmarkSpecificsToValue); | 
| 321   SET_EXTENSION(sync_pb, extension, ExtensionSpecificsToValue); | 331   SET_EXTENSION(sync_pb, extension, ExtensionSpecificsToValue); | 
|  | 332   SET_EXTENSION(sync_pb, extension_setting, ExtensionSettingSpecificsToValue); | 
| 322   SET_EXTENSION(sync_pb, nigori, NigoriSpecificsToValue); | 333   SET_EXTENSION(sync_pb, nigori, NigoriSpecificsToValue); | 
| 323   SET_EXTENSION(sync_pb, password, PasswordSpecificsToValue); | 334   SET_EXTENSION(sync_pb, password, PasswordSpecificsToValue); | 
| 324   SET_EXTENSION(sync_pb, preference, PreferenceSpecificsToValue); | 335   SET_EXTENSION(sync_pb, preference, PreferenceSpecificsToValue); | 
| 325   SET_EXTENSION(sync_pb, search_engine, SearchEngineSpecificsToValue); | 336   SET_EXTENSION(sync_pb, search_engine, SearchEngineSpecificsToValue); | 
| 326   SET_EXTENSION(sync_pb, session, SessionSpecificsToValue); | 337   SET_EXTENSION(sync_pb, session, SessionSpecificsToValue); | 
| 327   SET_EXTENSION(sync_pb, theme, ThemeSpecificsToValue); | 338   SET_EXTENSION(sync_pb, theme, ThemeSpecificsToValue); | 
| 328   SET_EXTENSION(sync_pb, typed_url, TypedUrlSpecificsToValue); | 339   SET_EXTENSION(sync_pb, typed_url, TypedUrlSpecificsToValue); | 
| 329   return value; | 340   return value; | 
| 330 } | 341 } | 
| 331 | 342 | 
| 332 #undef SET | 343 #undef SET | 
| 333 #undef SET_REP | 344 #undef SET_REP | 
| 334 | 345 | 
| 335 #undef SET_BOOL | 346 #undef SET_BOOL | 
| 336 #undef SET_BYTES | 347 #undef SET_BYTES | 
| 337 #undef SET_INT32 | 348 #undef SET_INT32 | 
| 338 #undef SET_INT64 | 349 #undef SET_INT64 | 
| 339 #undef SET_INT64_REP | 350 #undef SET_INT64_REP | 
| 340 #undef SET_STR | 351 #undef SET_STR | 
| 341 | 352 | 
| 342 #undef SET_EXTENSION | 353 #undef SET_EXTENSION | 
| 343 | 354 | 
| 344 }  // namespace browser_sync | 355 }  // namespace browser_sync | 
| OLD | NEW | 
|---|