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

Unified Diff: components/suggestions/suggestions_utils.cc

Issue 527943002: [Most Visited] Check for Sync state when using SuggestionsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/suggestions/suggestions_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/suggestions/suggestions_utils.cc
diff --git a/components/suggestions/suggestions_utils.cc b/components/suggestions/suggestions_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9c327917cfadc777be8c545a10a6e18a0722d442
--- /dev/null
+++ b/components/suggestions/suggestions_utils.cc
@@ -0,0 +1,22 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/suggestions/suggestions_utils.h"
+
+namespace suggestions {
+
+SyncState GetSyncState(bool sync_enabled,
+ bool sync_initialized,
+ bool history_sync_enabled) {
+ if (!sync_enabled)
+ return SYNC_OR_HISTORY_SYNC_DISABLED;
+
+ if (!sync_initialized)
+ return NOT_INITIALIZED_ENABLED;
+
+ return history_sync_enabled ?
+ INITIALIZED_ENABLED_HISTORY : SYNC_OR_HISTORY_SYNC_DISABLED;
+}
+
+} // namespace suggestions
« no previous file with comments | « components/suggestions/suggestions_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698