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

Unified Diff: components/suggestions/suggestions_service_impl.cc

Issue 2872573002: Use |min| param to query a variable number of suggestions (Closed)
Patch Set: Remove unnecessary includes 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
Index: components/suggestions/suggestions_service_impl.cc
diff --git a/components/suggestions/suggestions_service_impl.cc b/components/suggestions/suggestions_service_impl.cc
index 6e41445d9a6440f121ab56862d03f64791aaf4b5..6edab41bcf1d509eb2367a00b11f8491a41ad54d 100644
--- a/components/suggestions/suggestions_service_impl.cc
+++ b/components/suggestions/suggestions_service_impl.cc
@@ -22,6 +22,7 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/signin/core/browser/signin_manager_base.h"
#include "components/suggestions/blacklist_store.h"
+#include "components/suggestions/features.h"
#include "components/suggestions/image_manager.h"
#include "components/suggestions/suggestions_store.h"
#include "components/sync/driver/sync_service.h"
@@ -113,13 +114,14 @@ GURL GetGoogleBaseURL() {
// Format strings for the various suggestions URLs. They all have two string
// params: The Google base URL and the device type.
// TODO(mathp): Put this in TemplateURL.
-const char kSuggestionsURLFormat[] = "%schromesuggestions?t=%s";
+const char kSuggestionsURLFormat[] = "%schromesuggestions?%st=%s";
const char kSuggestionsBlacklistURLPrefixFormat[] =
"%schromesuggestions/blacklist?t=%s&url=";
const char kSuggestionsBlacklistClearURLFormat[] =
"%schromesuggestions/blacklist/clear?t=%s";
const char kSuggestionsBlacklistURLParam[] = "url";
+const char kSuggestionsUseAllParam[] = "all&";
Marc Treib 2017/05/08 14:26:04 Hm, I'm not a fan of "hiding" the "&" in here. IMO
fhorschig 2017/05/10 09:51:16 Done.
#if defined(OS_ANDROID) || defined(OS_IOS)
const char kDeviceType[] = "2";
@@ -277,7 +279,11 @@ void SuggestionsServiceImpl::RegisterProfilePrefs(
// static
GURL SuggestionsServiceImpl::BuildSuggestionsURL() {
return GURL(base::StringPrintf(
- kSuggestionsURLFormat, GetGoogleBaseURL().spec().c_str(), kDeviceType));
+ kSuggestionsURLFormat, GetGoogleBaseURL().spec().c_str(),
+ base::FeatureList::IsEnabled(kUseSuggestionsEvenIfFewFeature)
+ ? kSuggestionsUseAllParam
+ : "",
+ kDeviceType));
}
// static

Powered by Google App Engine
This is Rietveld 408576698