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

Side by Side Diff: components/suggestions/suggestions_utils.h

Issue 473123002: [Most Visited] Check for Sync state when using SuggestionsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new api Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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 #ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_
6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_
7
8 namespace suggestions {
9
10 // 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.
11 // specify. There are three different concepts in the sync service: initialized,
12 // sync enabled and history sync enabled.
13 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
14 // Sync service is not yet initialized, yet not disabled. History sync state
15 // 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.
16 NOT_INITIALIZED_ENABLED,
17
18 // Sync service is initialized, sync is enabled and history sync is enabled.
19 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.
20
21 // Sync service is disabled (initialized or not) OR initialized and enabled
22 // with no history sync.
23 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.
24 };
25
26 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.
27 bool sync_enabled,
28 bool history_sync_enabled);
29
30 } // namespace suggestions
31
32 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698