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.
5 #ifndef COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_
6 #define COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_
8 namespace suggestions
{
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.
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
18 NOT_INITIALIZED_ENABLED
,
20 // State: Sync service is initialized, sync is enabled and history sync is
22 // Behavior: Update suggestions from the server. Serve from cache on timeout.
23 INITIALIZED_ENABLED_HISTORY
,
25 // State: Sync service is disabled or history sync is disabled.
26 // Behavior: Do not issue a server request. Clear the cache. Serve empty
28 SYNC_OR_HISTORY_SYNC_DISABLED
,
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
);
36 } // namespace suggestions
38 #endif // COMPONENTS_SUGGESTIONS_SUGGESTIONS_UTILS_H_