| 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);
|
|
|