Chromium Code Reviews| 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..84652fbd13660978f69bff5a011b19eb349a7b2d 100644 |
| --- a/chrome/browser/ui/views/default_search_view.cc |
| +++ b/chrome/browser/ui/views/default_search_view.cc |
| @@ -30,18 +30,18 @@ |
| namespace { |
| // Returns a short name and logo resource id for the given host. |
| -void GetShortNameAndLogoId(PrefService* prefs, |
| +void GetShortNameAndLogoId(Profile* profile, |
|
Peter Kasting
2011/08/10 20:54:06
All the changes in this file can end up being reve
|
| 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); |
| + GURL url = TemplateURLService::GenerateSearchURL(turl, profile); |
| scoped_ptr<TemplateURL> built_in_data( |
| - TemplateURLPrepopulateData::GetEngineForOrigin(prefs, url)); |
| + TemplateURLPrepopulateData::GetEngineForOrigin(profile, url)); |
| // Use the built-in information to generate the short name (to ensure |
| // that we don't use a name given by the search engine to itself which |
| @@ -189,14 +189,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 +209,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 +220,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); |