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 #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 Loading... |
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 |
OLD | NEW |