Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |