Index: components/suggestions/suggestions_utils.h |
diff --git a/components/suggestions/suggestions_utils.h b/components/suggestions/suggestions_utils.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6b344c46e98a4d743bbbdcca33b75c4ab0639005 |
--- /dev/null |
+++ b/components/suggestions/suggestions_utils.h |
@@ -0,0 +1,32 @@ |
+// 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. |
+ |
+#ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_ |
+#define COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_ |
+ |
+namespace suggestions { |
+ |
+// Establishes the different sync states that users of SuggestionsService can |
manzagop (departed)
2014/08/20 15:43:51
nit: double space "of Sugg...".
Mathieu
2014/08/20 18:41:29
Done.
|
+// specify. There are three different concepts in the sync service: initialized, |
+// sync enabled and history sync enabled. |
+enum SyncState { |
manzagop (departed)
2014/08/20 15:43:51
Nit: how about FetchType: CACHE, SERVER, CLEAR.
B
Mathieu
2014/08/20 18:41:30
Ack. Discussed offline. I don't want users of Sugg
|
+ // Sync service is not yet initialized, yet not disabled. History sync state |
+ // is unknown (since not initialized). |
manzagop (departed)
2014/08/20 15:43:51
Maybe document the fetch type, instead of what mot
Mathieu
2014/08/20 18:41:29
Done.
|
+ NOT_INITIALIZED_ENABLED, |
+ |
+ // Sync service is initialized, sync is enabled and history sync is enabled. |
+ INITIALIZED_ENABLED_HISTORY, |
manzagop (departed)
2014/08/20 15:43:51
Update suggestions from the server. Serve from cac
Mathieu
2014/08/20 18:41:29
Done.
|
+ |
+ // Sync service is disabled (initialized or not) OR initialized and enabled |
+ // with no history sync. |
+ DISABLED, |
manzagop (departed)
2014/08/20 15:43:51
Do not issue a server request. Clear the cache.
Mathieu
2014/08/20 18:41:29
Done.
|
+}; |
+ |
+SyncState GetSyncState(bool sync_initialized, |
manzagop (departed)
2014/08/20 15:43:51
Perhaps this is where you can document what condit
Mathieu
2014/08/20 18:41:29
Acknowledged.
|
+ bool sync_enabled, |
+ bool history_sync_enabled); |
+ |
+} // namespace suggestions |
+ |
+#endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_ |