OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "sync/syncable/nigori_util.h" | 5 #include "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 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return false; | 165 return false; |
166 } | 166 } |
167 if ((!SpecificsNeedsEncryption(encrypted_types, new_specifics) && | 167 if ((!SpecificsNeedsEncryption(encrypted_types, new_specifics) && |
168 !was_encrypted) || | 168 !was_encrypted) || |
169 !cryptographer->is_initialized()) { | 169 !cryptographer->is_initialized()) { |
170 // No encryption required or we are unable to encrypt. | 170 // No encryption required or we are unable to encrypt. |
171 generated_specifics.CopyFrom(new_specifics); | 171 generated_specifics.CopyFrom(new_specifics); |
172 } else { | 172 } else { |
173 // Encrypt new_specifics into generated_specifics. | 173 // Encrypt new_specifics into generated_specifics. |
174 if (VLOG_IS_ON(2)) { | 174 if (VLOG_IS_ON(2)) { |
175 scoped_ptr<DictionaryValue> value(entry->ToValue(NULL)); | 175 scoped_ptr<base::DictionaryValue> value(entry->ToValue(NULL)); |
176 std::string info; | 176 std::string info; |
177 base::JSONWriter::WriteWithOptions(value.get(), | 177 base::JSONWriter::WriteWithOptions(value.get(), |
178 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 178 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
179 &info); | 179 &info); |
180 DVLOG(2) << "Encrypting specifics of type " | 180 DVLOG(2) << "Encrypting specifics of type " |
181 << ModelTypeToString(type) | 181 << ModelTypeToString(type) |
182 << " with content: " | 182 << " with content: " |
183 << info; | 183 << info; |
184 } | 184 } |
185 // Only copy over the old specifics if it is of the right type and already | 185 // Only copy over the old specifics if it is of the right type and already |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 encrypted_types.Put(DICTIONARY); | 307 encrypted_types.Put(DICTIONARY); |
308 if (nigori.encrypt_favicon_images()) | 308 if (nigori.encrypt_favicon_images()) |
309 encrypted_types.Put(FAVICON_IMAGES); | 309 encrypted_types.Put(FAVICON_IMAGES); |
310 if (nigori.encrypt_favicon_tracking()) | 310 if (nigori.encrypt_favicon_tracking()) |
311 encrypted_types.Put(FAVICON_TRACKING); | 311 encrypted_types.Put(FAVICON_TRACKING); |
312 return encrypted_types; | 312 return encrypted_types; |
313 } | 313 } |
314 | 314 |
315 } // namespace syncable | 315 } // namespace syncable |
316 } // namespace syncer | 316 } // namespace syncer |
OLD | NEW |