| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 } | 1340 } |
| 1341 | 1341 |
| 1342 bool SyncManagerImpl::ReceivedExperiment(Experiments* experiments) { | 1342 bool SyncManagerImpl::ReceivedExperiment(Experiments* experiments) { |
| 1343 ReadTransaction trans(FROM_HERE, GetUserShare()); | 1343 ReadTransaction trans(FROM_HERE, GetUserShare()); |
| 1344 ReadNode nigori_node(&trans); | 1344 ReadNode nigori_node(&trans); |
| 1345 if (nigori_node.InitByTagLookup(kNigoriTag) != BaseNode::INIT_OK) { | 1345 if (nigori_node.InitByTagLookup(kNigoriTag) != BaseNode::INIT_OK) { |
| 1346 DVLOG(1) << "Couldn't find Nigori node."; | 1346 DVLOG(1) << "Couldn't find Nigori node."; |
| 1347 return false; | 1347 return false; |
| 1348 } | 1348 } |
| 1349 bool found_experiment = false; | 1349 bool found_experiment = false; |
| 1350 if (nigori_node.GetNigoriSpecifics().sync_tab_favicons()) { | |
| 1351 experiments->sync_tab_favicons = true; | |
| 1352 found_experiment = true; | |
| 1353 } | |
| 1354 | 1350 |
| 1355 ReadNode keystore_node(&trans); | 1351 ReadNode keystore_node(&trans); |
| 1356 if (keystore_node.InitByClientTagLookup( | 1352 if (keystore_node.InitByClientTagLookup( |
| 1357 syncer::EXPERIMENTS, | 1353 syncer::EXPERIMENTS, |
| 1358 syncer::kKeystoreEncryptionTag) == BaseNode::INIT_OK && | 1354 syncer::kKeystoreEncryptionTag) == BaseNode::INIT_OK && |
| 1359 keystore_node.GetExperimentsSpecifics().keystore_encryption().enabled()) { | 1355 keystore_node.GetExperimentsSpecifics().keystore_encryption().enabled()) { |
| 1360 experiments->keystore_encryption = true; | 1356 experiments->keystore_encryption = true; |
| 1361 found_experiment = true; | 1357 found_experiment = true; |
| 1362 } | 1358 } |
| 1363 | 1359 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1374 ReadNode full_history_sync_node(&trans); | 1370 ReadNode full_history_sync_node(&trans); |
| 1375 if (full_history_sync_node.InitByClientTagLookup( | 1371 if (full_history_sync_node.InitByClientTagLookup( |
| 1376 syncer::EXPERIMENTS, | 1372 syncer::EXPERIMENTS, |
| 1377 syncer::kFullHistorySyncTag) == BaseNode::INIT_OK && | 1373 syncer::kFullHistorySyncTag) == BaseNode::INIT_OK && |
| 1378 full_history_sync_node.GetExperimentsSpecifics(). | 1374 full_history_sync_node.GetExperimentsSpecifics(). |
| 1379 history_delete_directives().enabled()) { | 1375 history_delete_directives().enabled()) { |
| 1380 experiments->full_history_sync = true; | 1376 experiments->full_history_sync = true; |
| 1381 found_experiment = true; | 1377 found_experiment = true; |
| 1382 } | 1378 } |
| 1383 | 1379 |
| 1380 ReadNode favicon_sync_node(&trans); |
| 1381 if (favicon_sync_node.InitByClientTagLookup( |
| 1382 syncer::EXPERIMENTS, |
| 1383 syncer::kFaviconSyncTag) == BaseNode::INIT_OK && |
| 1384 favicon_sync_node.GetExperimentsSpecifics().favicon_sync().enabled()) { |
| 1385 experiments->favicon_sync = true; |
| 1386 found_experiment = true; |
| 1387 } |
| 1388 |
| 1384 return found_experiment; | 1389 return found_experiment; |
| 1385 } | 1390 } |
| 1386 | 1391 |
| 1387 bool SyncManagerImpl::HasUnsyncedItems() { | 1392 bool SyncManagerImpl::HasUnsyncedItems() { |
| 1388 ReadTransaction trans(FROM_HERE, GetUserShare()); | 1393 ReadTransaction trans(FROM_HERE, GetUserShare()); |
| 1389 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); | 1394 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); |
| 1390 } | 1395 } |
| 1391 | 1396 |
| 1392 SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() { | 1397 SyncEncryptionHandler* SyncManagerImpl::GetEncryptionHandler() { |
| 1393 return sync_encryption_handler_.get(); | 1398 return sync_encryption_handler_.get(); |
| 1394 } | 1399 } |
| 1395 | 1400 |
| 1396 // static. | 1401 // static. |
| 1397 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1402 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1398 return kDefaultNudgeDelayMilliseconds; | 1403 return kDefaultNudgeDelayMilliseconds; |
| 1399 } | 1404 } |
| 1400 | 1405 |
| 1401 // static. | 1406 // static. |
| 1402 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1407 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1403 return kPreferencesNudgeDelayMilliseconds; | 1408 return kPreferencesNudgeDelayMilliseconds; |
| 1404 } | 1409 } |
| 1405 | 1410 |
| 1406 } // namespace syncer | 1411 } // namespace syncer |
| OLD | NEW |