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

Unified Diff: chrome/browser/ui/views/default_search_view.cc

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: 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/ui/views/default_search_view.cc
diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc
index da1a8c5b2446e56ebd5c5cf526a4df29ec9fe3fe..0e7420f93eb6ac643776519cdff8266125099975 100644
--- a/chrome/browser/ui/views/default_search_view.cc
+++ b/chrome/browser/ui/views/default_search_view.cc
@@ -30,16 +30,19 @@
namespace {
// Returns a short name and logo resource id for the given host.
-void GetShortNameAndLogoId(PrefService* prefs,
+void GetShortNameAndLogoId(Profile* profile,
const TemplateURL* turl,
std::wstring* short_name,
int* logo_id) {
- DCHECK(prefs);
+ DCHECK(profile);
DCHECK(turl);
DCHECK(short_name);
DCHECK(logo_id);
- GURL url = TemplateURLService::GenerateSearchURL(turl);
+ PrefService* prefs = profile->GetPrefs();
+ DCHECK(prefs);
+
+ GURL url = TemplateURLService::GenerateSearchURL(profile, turl);
scoped_ptr<TemplateURL> built_in_data(
TemplateURLPrepopulateData::GetEngineForOrigin(prefs, url));
@@ -189,14 +192,13 @@ DefaultSearchView::DefaultSearchView(TabContents* tab_contents,
template_url_service_(template_url_service) {
Profile* profile =
Profile::FromBrowserContext(tab_contents->browser_context());
- PrefService* prefs = profile->GetPrefs();
- SetupControls(prefs);
+ SetupControls(profile);
// Show the dialog.
tab_contents->CreateConstrainedDialog(this);
}
-void DefaultSearchView::SetupControls(PrefService* prefs) {
+void DefaultSearchView::SetupControls(Profile* profile) {
using views::ColumnSet;
using views::GridLayout;
using views::ImageView;
@@ -210,7 +212,7 @@ void DefaultSearchView::SetupControls(PrefService* prefs) {
// Set up the information for the proposed default.
std::wstring proposed_short_name;
int proposed_logo_id = kNoSearchEngineLogo;
- GetShortNameAndLogoId(prefs,
+ GetShortNameAndLogoId(profile,
proposed_turl_.get(),
&proposed_short_name,
&proposed_logo_id);
@@ -221,7 +223,7 @@ void DefaultSearchView::SetupControls(PrefService* prefs) {
// Set up the information for the current default.
std::wstring default_short_name;
int default_logo_id = kNoSearchEngineLogo;
- GetShortNameAndLogoId(prefs,
+ GetShortNameAndLogoId(profile,
template_url_service_->GetDefaultSearchProvider(),
&default_short_name,
&default_logo_id);

Powered by Google App Engine
This is Rietveld 408576698