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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 207 |
207 DictionaryValue* BookmarkSpecificsToValue( | 208 DictionaryValue* BookmarkSpecificsToValue( |
208 const sync_pb::BookmarkSpecifics& proto) { | 209 const sync_pb::BookmarkSpecifics& proto) { |
209 DictionaryValue* value = new DictionaryValue(); | 210 DictionaryValue* value = new DictionaryValue(); |
210 SET_STR(url); | 211 SET_STR(url); |
211 SET_BYTES(favicon); | 212 SET_BYTES(favicon); |
212 SET_STR(title); | 213 SET_STR(title); |
213 return value; | 214 return value; |
214 } | 215 } |
215 | 216 |
| 217 DictionaryValue* ExtensionSettingSpecificsToValue( |
| 218 const sync_pb::ExtensionSettingSpecifics& proto) { |
| 219 DictionaryValue* value = new DictionaryValue(); |
| 220 SET_STR(extension_id); |
| 221 SET_STR(key); |
| 222 SET_STR(value); |
| 223 return value; |
| 224 } |
| 225 |
216 DictionaryValue* ExtensionSpecificsToValue( | 226 DictionaryValue* ExtensionSpecificsToValue( |
217 const sync_pb::ExtensionSpecifics& proto) { | 227 const sync_pb::ExtensionSpecifics& proto) { |
218 DictionaryValue* value = new DictionaryValue(); | 228 DictionaryValue* value = new DictionaryValue(); |
219 SET_STR(id); | 229 SET_STR(id); |
220 SET_STR(version); | 230 SET_STR(version); |
221 SET_STR(update_url); | 231 SET_STR(update_url); |
222 SET_BOOL(enabled); | 232 SET_BOOL(enabled); |
223 SET_BOOL(incognito_enabled); | 233 SET_BOOL(incognito_enabled); |
224 SET_STR(name); | 234 SET_STR(name); |
225 return value; | 235 return value; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } | 325 } |
316 | 326 |
317 DictionaryValue* EntitySpecificsToValue( | 327 DictionaryValue* EntitySpecificsToValue( |
318 const sync_pb::EntitySpecifics& specifics) { | 328 const sync_pb::EntitySpecifics& specifics) { |
319 DictionaryValue* value = new DictionaryValue(); | 329 DictionaryValue* value = new DictionaryValue(); |
320 SET_EXTENSION(sync_pb, app, AppSpecificsToValue); | 330 SET_EXTENSION(sync_pb, app, AppSpecificsToValue); |
321 SET_EXTENSION(sync_pb, autofill, AutofillSpecificsToValue); | 331 SET_EXTENSION(sync_pb, autofill, AutofillSpecificsToValue); |
322 SET_EXTENSION(sync_pb, autofill_profile, AutofillProfileSpecificsToValue); | 332 SET_EXTENSION(sync_pb, autofill_profile, AutofillProfileSpecificsToValue); |
323 SET_EXTENSION(sync_pb, bookmark, BookmarkSpecificsToValue); | 333 SET_EXTENSION(sync_pb, bookmark, BookmarkSpecificsToValue); |
324 SET_EXTENSION(sync_pb, extension, ExtensionSpecificsToValue); | 334 SET_EXTENSION(sync_pb, extension, ExtensionSpecificsToValue); |
| 335 SET_EXTENSION(sync_pb, extension_setting, ExtensionSettingSpecificsToValue); |
325 SET_EXTENSION(sync_pb, nigori, NigoriSpecificsToValue); | 336 SET_EXTENSION(sync_pb, nigori, NigoriSpecificsToValue); |
326 SET_EXTENSION(sync_pb, password, PasswordSpecificsToValue); | 337 SET_EXTENSION(sync_pb, password, PasswordSpecificsToValue); |
327 SET_EXTENSION(sync_pb, preference, PreferenceSpecificsToValue); | 338 SET_EXTENSION(sync_pb, preference, PreferenceSpecificsToValue); |
328 SET_EXTENSION(sync_pb, search_engine, SearchEngineSpecificsToValue); | 339 SET_EXTENSION(sync_pb, search_engine, SearchEngineSpecificsToValue); |
329 SET_EXTENSION(sync_pb, session, SessionSpecificsToValue); | 340 SET_EXTENSION(sync_pb, session, SessionSpecificsToValue); |
330 SET_EXTENSION(sync_pb, theme, ThemeSpecificsToValue); | 341 SET_EXTENSION(sync_pb, theme, ThemeSpecificsToValue); |
331 SET_EXTENSION(sync_pb, typed_url, TypedUrlSpecificsToValue); | 342 SET_EXTENSION(sync_pb, typed_url, TypedUrlSpecificsToValue); |
332 return value; | 343 return value; |
333 } | 344 } |
334 | 345 |
335 #undef SET | 346 #undef SET |
336 #undef SET_REP | 347 #undef SET_REP |
337 | 348 |
338 #undef SET_BOOL | 349 #undef SET_BOOL |
339 #undef SET_BYTES | 350 #undef SET_BYTES |
340 #undef SET_INT32 | 351 #undef SET_INT32 |
341 #undef SET_INT64 | 352 #undef SET_INT64 |
342 #undef SET_INT64_REP | 353 #undef SET_INT64_REP |
343 #undef SET_STR | 354 #undef SET_STR |
344 | 355 |
345 #undef SET_EXTENSION | 356 #undef SET_EXTENSION |
346 | 357 |
347 } // namespace browser_sync | 358 } // namespace browser_sync |
OLD | NEW |