OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/default_search_view.h" | 5 #include "chrome/browser/ui/views/default_search_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 DefaultSearchView::DefaultSearchView(TabContents* tab_contents, | 182 DefaultSearchView::DefaultSearchView(TabContents* tab_contents, |
183 TemplateURL* proposed_default_turl, | 183 TemplateURL* proposed_default_turl, |
184 TemplateURLService* template_url_service) | 184 TemplateURLService* template_url_service) |
185 : background_image_(NULL), | 185 : background_image_(NULL), |
186 default_provider_button_(NULL), | 186 default_provider_button_(NULL), |
187 proposed_provider_button_(NULL), | 187 proposed_provider_button_(NULL), |
188 proposed_turl_(proposed_default_turl), | 188 proposed_turl_(proposed_default_turl), |
189 template_url_service_(template_url_service) { | 189 template_url_service_(template_url_service) { |
190 PrefService* prefs = tab_contents->profile()->GetPrefs(); | 190 Profile* profile = static_cast<Profile*>(tab_contents->browser_context()); |
| 191 PrefService* prefs = profile->GetPrefs(); |
191 SetupControls(prefs); | 192 SetupControls(prefs); |
192 | 193 |
193 // Show the dialog. | 194 // Show the dialog. |
194 tab_contents->CreateConstrainedDialog(this); | 195 tab_contents->CreateConstrainedDialog(this); |
195 } | 196 } |
196 | 197 |
197 void DefaultSearchView::SetupControls(PrefService* prefs) { | 198 void DefaultSearchView::SetupControls(PrefService* prefs) { |
198 using views::ColumnSet; | 199 using views::ColumnSet; |
199 using views::GridLayout; | 200 using views::GridLayout; |
200 using views::ImageView; | 201 using views::ImageView; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 this, | 302 this, |
302 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, | 303 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, |
303 default_short_name); | 304 default_short_name); |
304 layout->AddView(default_provider_button_); | 305 layout->AddView(default_provider_button_); |
305 proposed_provider_button_ = CreateProviderChoiceButton( | 306 proposed_provider_button_ = CreateProviderChoiceButton( |
306 this, | 307 this, |
307 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, | 308 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, |
308 proposed_short_name); | 309 proposed_short_name); |
309 layout->AddView(proposed_provider_button_); | 310 layout->AddView(proposed_provider_button_); |
310 } | 311 } |
OLD | NEW |