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

Side by Side Diff: chrome/browser/sync/syncable/nigori_util.cc

Issue 7150023: Add protobuffer and model type for syncing custom search engines. Includes all boilerplate helper... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « chrome/browser/sync/syncable/model_type.cc ('k') | chrome/browser/sync/util/cryptographer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/sync/syncable/nigori_util.h" 5 #include "chrome/browser/sync/syncable/nigori_util.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "chrome/browser/sync/engine/syncer_util.h" 11 #include "chrome/browser/sync/engine/syncer_util.h"
12 #include "chrome/browser/sync/syncable/syncable.h" 12 #include "chrome/browser/sync/syncable/syncable.h"
13 #include "chrome/browser/sync/util/cryptographer.h" 13 #include "chrome/browser/sync/util/cryptographer.h"
14 14
15 namespace syncable { 15 namespace syncable {
16 void FillNigoriEncryptedTypes(const ModelTypeSet& types, 16 void FillNigoriEncryptedTypes(const ModelTypeSet& types,
17 sync_pb::NigoriSpecifics* nigori) { 17 sync_pb::NigoriSpecifics* nigori) {
18 DCHECK(nigori); 18 DCHECK(nigori);
19 nigori->set_encrypt_bookmarks(types.count(BOOKMARKS) > 0); 19 nigori->set_encrypt_bookmarks(types.count(BOOKMARKS) > 0);
20 nigori->set_encrypt_preferences(types.count(PREFERENCES) > 0); 20 nigori->set_encrypt_preferences(types.count(PREFERENCES) > 0);
21 nigori->set_encrypt_autofill_profile(types.count(AUTOFILL_PROFILE) > 0); 21 nigori->set_encrypt_autofill_profile(types.count(AUTOFILL_PROFILE) > 0);
22 nigori->set_encrypt_autofill(types.count(AUTOFILL) > 0); 22 nigori->set_encrypt_autofill(types.count(AUTOFILL) > 0);
23 nigori->set_encrypt_themes(types.count(THEMES) > 0); 23 nigori->set_encrypt_themes(types.count(THEMES) > 0);
24 nigori->set_encrypt_typed_urls(types.count(TYPED_URLS) > 0); 24 nigori->set_encrypt_typed_urls(types.count(TYPED_URLS) > 0);
25 nigori->set_encrypt_extensions(types.count(EXTENSIONS) > 0); 25 nigori->set_encrypt_extensions(types.count(EXTENSIONS) > 0);
26 nigori->set_encrypt_search_engines(types.count(SEARCH_ENGINES) > 0);
26 nigori->set_encrypt_sessions(types.count(SESSIONS) > 0); 27 nigori->set_encrypt_sessions(types.count(SESSIONS) > 0);
27 nigori->set_encrypt_apps(types.count(APPS) > 0); 28 nigori->set_encrypt_apps(types.count(APPS) > 0);
28 } 29 }
29 30
30 bool ProcessUnsyncedChangesForEncryption( 31 bool ProcessUnsyncedChangesForEncryption(
31 WriteTransaction* const trans, 32 WriteTransaction* const trans,
32 const ModelTypeSet& encrypted_types, 33 const ModelTypeSet& encrypted_types,
33 browser_sync::Cryptographer* cryptographer) { 34 browser_sync::Cryptographer* cryptographer) {
34 // Get list of all datatypes with unsynced changes. It's possible that our 35 // Get list of all datatypes with unsynced changes. It's possible that our
35 // local changes need to be encrypted if encryption for that datatype was 36 // local changes need to be encrypted if encryption for that datatype was
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 if (specifics.has_encrypted() != is_encrypted) 144 if (specifics.has_encrypted() != is_encrypted)
144 return false; 145 return false;
145 } 146 }
146 // Push the successor. 147 // Push the successor.
147 to_visit.push(child.Get(NEXT_ID)); 148 to_visit.push(child.Get(NEXT_ID));
148 } 149 }
149 return true; 150 return true;
150 } 151 }
151 152
152 } // namespace syncable 153 } // namespace syncable
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/model_type.cc ('k') | chrome/browser/sync/util/cryptographer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698