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

Unified Diff: chrome/browser/search_engines/search_terms_data.h

Issue 9581026: Don't set ion=1 for hidden Instant modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « no previous file | chrome/browser/search_engines/search_terms_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/search_terms_data.h
diff --git a/chrome/browser/search_engines/search_terms_data.h b/chrome/browser/search_engines/search_terms_data.h
index dd4468aa8c2e4011d21709d48616678ee59ce2e4..fc1fe09b432a52f48597308c32d5ac12a6e0e5ff 100644
--- a/chrome/browser/search_engines/search_terms_data.h
+++ b/chrome/browser/search_engines/search_terms_data.h
@@ -35,6 +35,14 @@ class SearchTermsData {
virtual string16 GetRlzParameterValue() const = 0;
#endif
+ // Returns a string indicating whether Instant (in the visible-preview mode)
+ // is enabled, suitable for adding as a query string param to the homepage
+ // (instant_url) request. Returns an empty string if Instant is disabled,
+ // or if it's only active in a hidden field trial mode. Determining this
+ // requires accessing the Profile, so this can only ever be non-empty for
+ // UIThreadSearchTermsData.
+ virtual std::string InstantEnabledParam() const;
+
// Returns a string indicating the Instant field trial group, suitable for
// adding as a query string param to suggest/search URLs, or an empty string
// if the field trial is not active. Checking the field trial group requires
@@ -51,8 +59,8 @@ class UIThreadSearchTermsData : public SearchTermsData {
public:
UIThreadSearchTermsData();
- // Callers who need an accurate answer from InstantFieldTrialUrlParam() must
- // set the profile here before calling that.
+ // Callers who need an accurate answer from InstantFieldTrialUrlParam() or
+ // InstantEnabledParam() must set the profile here before calling them.
void set_profile(Profile* profile) { profile_ = profile; }
// Implementation of SearchTermsData.
@@ -64,6 +72,10 @@ class UIThreadSearchTermsData : public SearchTermsData {
// This returns the empty string unless set_profile() has been called with a
// non-NULL Profile.
+ virtual std::string InstantEnabledParam() const OVERRIDE;
+
+ // This returns the empty string unless set_profile() has been called with a
+ // non-NULL Profile.
virtual std::string InstantFieldTrialUrlParam() const OVERRIDE;
// Used by tests to set the value for the Google base url. This takes
« no previous file with comments | « no previous file | chrome/browser/search_engines/search_terms_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698