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

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

Issue 7558014: Add a URL param to indicate group selection in Instant field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passing NULL as far as possible Created 9 years, 4 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: 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 a695a113c7eca0c3c50913ef03895142f98e1622..d8bc0ba78b116d02e158c45473501703b35695ad 100644
--- a/chrome/browser/search_engines/search_terms_data.h
+++ b/chrome/browser/search_engines/search_terms_data.h
@@ -11,6 +11,8 @@
#include "base/basictypes.h"
#include "base/string16.h"
+class Profile;
+
// All data needed by TemplateURLRef::ReplaceSearchTerms which typically may
// only be accessed on the UI thread.
class SearchTermsData {
@@ -32,6 +34,11 @@ class SearchTermsData {
virtual string16 GetRlzParameterValue() const = 0;
#endif
+ // 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.
+ virtual std::string InstantFieldTrialUrlParam() const;
+
private:
DISALLOW_COPY_AND_ASSIGN(SearchTermsData);
};
@@ -39,7 +46,10 @@ class SearchTermsData {
// Implementation of SearchTermsData that is only usable on the UI thread.
class UIThreadSearchTermsData : public SearchTermsData {
public:
- UIThreadSearchTermsData();
+ // |profile| is needed only to create URL params related to the Instant field
+ // trial. Most users don't care about those params, so it's okay to pass in a
+ // NULL profile.
+ explicit UIThreadSearchTermsData(Profile* profile);
Peter Kasting 2011/08/11 00:35:17 I wonder if it would be even simpler to leave this
// Implementation of SearchTermsData.
virtual std::string GoogleBaseURLValue() const;
@@ -47,6 +57,7 @@ class UIThreadSearchTermsData : public SearchTermsData {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
virtual string16 GetRlzParameterValue() const;
#endif
+ virtual std::string InstantFieldTrialUrlParam() const;
// Used by tests to set the value for the Google base url. This takes
// ownership of the given std::string.
@@ -55,6 +66,8 @@ class UIThreadSearchTermsData : public SearchTermsData {
private:
static std::string* google_base_url_;
+ Profile* const profile_;
+
DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData);
};

Powered by Google App Engine
This is Rietveld 408576698