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

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

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 unified diff | Download patch
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
11 // specify. There are three different concepts in the sync service: initialized,
12 // sync enabled and history sync enabled.
13 enum SyncState {
14 // State: Sync service is not initialized, yet not disabled. History sync
15 // state is unknown (since not initialized).
16 // Behavior: Does not issue a server request, but serves from cache if
17 // available.
18 NOT_INITIALIZED_ENABLED,
19
20 // State: Sync service is initialized, sync is enabled and history sync is
21 // enabled.
22 // Behavior: Update suggestions from the server. Serve from cache on timeout.
23 INITIALIZED_ENABLED_HISTORY,
24
25 // State: Sync service is disabled or history sync is disabled.
26 // Behavior: Do not issue a server request. Clear the cache. Serve empty
27 // suggestions.
28 SYNC_OR_HISTORY_SYNC_DISABLED,
29 };
30
31 // Users of SuggestionsService should always use this function to get SyncState.
32 SyncState GetSyncState(bool sync_enabled,
33 bool sync_initialized,
34 bool history_sync_enabled);
35
36 } // namespace suggestions
37
38 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_
OLDNEW
« no previous file with comments | « components/suggestions/suggestions_service_unittest.cc ('k') | components/suggestions/suggestions_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698