1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/sync_driver/sync_service_utils.h"
7 #include "components/sync_driver/sync_prefs.h"
8 #include "components/sync_driver/sync_service.h"
10 namespace sync_driver
{
12 bool IsTabSyncEnabledAndUnencrypted(SyncService
* sync_service
,
13 PrefService
* pref_service
) {
14 // Check field trials and settings allow sending the URL on suggest requests.
15 sync_driver::SyncPrefs
sync_prefs(pref_service
);
16 return sync_service
&& sync_service
->CanSyncStart() &&
17 sync_prefs
.GetPreferredDataTypes(syncer::UserTypes())
18 .Has(syncer::PROXY_TABS
) &&
19 !sync_service
->GetEncryptedDataTypes().Has(syncer::SESSIONS
);
22 } // namespace sync_driver