OLD | NEW |
| (Empty) |
1 // Copyright 2016 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. | |
4 | |
5 #include "chrome/browser/search/suggestions/suggestions_utils.h" | |
6 | |
7 #include "chrome/browser/profiles/profile.h" | |
8 #include "chrome/browser/sync/profile_sync_service_factory.h" | |
9 #include "components/browser_sync/browser/profile_sync_service.h" | |
10 | |
11 namespace suggestions { | |
12 | |
13 SyncState GetSyncState(Profile* profile) { | |
14 ProfileSyncService* sync = | |
15 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | |
16 if (!sync) | |
17 return SyncState::SYNC_OR_HISTORY_SYNC_DISABLED; | |
18 return GetSyncState( | |
19 sync->CanSyncStart(), sync->IsSyncActive() && sync->ConfigurationDone(), | |
20 sync->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES)); | |
21 } | |
22 | |
23 } // namespace suggestions | |
OLD | NEW |