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

Unified Diff: components/suggestions/suggestions_service_impl.h

Issue 2866013002: SuggestionsService: don't automatically fetch on startup (Closed)
Patch Set: review Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/suggestions/suggestions_service.h ('k') | components/suggestions/suggestions_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/suggestions/suggestions_service_impl.h
diff --git a/components/suggestions/suggestions_service_impl.h b/components/suggestions/suggestions_service_impl.h
index b2ce16238fed17cc77dc70dd609f4c35b9e913f3..7bd2959d65b3a3d315adc732a59b799f8d543d56 100644
--- a/components/suggestions/suggestions_service_impl.h
+++ b/components/suggestions/suggestions_service_impl.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/callback_list.h"
+#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
@@ -90,6 +91,7 @@ class SuggestionsServiceImpl : public SuggestionsService,
FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, IgnoresNoopSyncChange);
FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
IgnoresUninterestingSyncChange);
+ FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest, DoesNotFetchOnStartup);
FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
FetchSuggestionsDataSyncNotInitializedEnabled);
FRIEND_TEST_ALL_PREFIXES(SuggestionsServiceTest,
@@ -132,6 +134,9 @@ class SuggestionsServiceImpl : public SuggestionsService,
SYNC_OR_HISTORY_SYNC_DISABLED,
};
+ // The action that should be taken as the result of a RefreshSyncState call.
+ enum RefreshAction { NO_ACTION, FETCH_SUGGESTIONS, CLEAR_SUGGESTIONS };
+
// Helpers to build the various suggestions URLs. These are static members
// rather than local functions in the .cc file to make them accessible to
// tests.
@@ -143,9 +148,9 @@ class SuggestionsServiceImpl : public SuggestionsService,
// Computes the appropriate SyncState from |sync_service_|.
SyncState ComputeSyncState() const;
- // Re-computes |sync_state_| from the sync service. Returns whether
- // |sync_state_| was changed.
- bool RefreshSyncState();
+ // Re-computes |sync_state_| from the sync service. Returns the action that
+ // should be taken in response.
+ RefreshAction RefreshSyncState() WARN_UNUSED_RESULT;
// syncer::SyncServiceObserver implementation.
void OnStateChanged(syncer::SyncService* sync) override;
« no previous file with comments | « components/suggestions/suggestions_service.h ('k') | components/suggestions/suggestions_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698