Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chrome/browser/search/suggestions/suggestions_utils.cc

Issue 1770843002: SuggestionsService: implement SyncServiceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix2 Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698