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

Side by Side Diff: chrome/browser/ui/views/default_search_view.cc

Issue 7189019: Fix even more crashes. To help identify remaining crashes now and in the future, I have made the ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // displayed. 164 // displayed.
165 TemplateURL* set_as_default = proposed_turl_.get(); 165 TemplateURL* set_as_default = proposed_turl_.get();
166 if (!template_url_service_->CanMakeDefault(set_as_default)) 166 if (!template_url_service_->CanMakeDefault(set_as_default))
167 return true; 167 return true;
168 168
169 template_url_service_->Add(proposed_turl_.release()); 169 template_url_service_->Add(proposed_turl_.release());
170 template_url_service_->SetDefaultSearchProvider(set_as_default); 170 template_url_service_->SetDefaultSearchProvider(set_as_default);
171 return true; 171 return true;
172 } 172 }
173 173
174 views::Widget* DefaultSearchView::GetWidget() {
175 return View::GetWidget();
176 }
177
178 const views::Widget* DefaultSearchView::GetWidget() const {
179 return View::GetWidget();
180 }
181
174 DefaultSearchView::DefaultSearchView(TabContents* tab_contents, 182 DefaultSearchView::DefaultSearchView(TabContents* tab_contents,
175 TemplateURL* proposed_default_turl, 183 TemplateURL* proposed_default_turl,
176 TemplateURLService* template_url_service) 184 TemplateURLService* template_url_service)
177 : background_image_(NULL), 185 : background_image_(NULL),
178 default_provider_button_(NULL), 186 default_provider_button_(NULL),
179 proposed_provider_button_(NULL), 187 proposed_provider_button_(NULL),
180 proposed_turl_(proposed_default_turl), 188 proposed_turl_(proposed_default_turl),
181 template_url_service_(template_url_service) { 189 template_url_service_(template_url_service) {
182 PrefService* prefs = tab_contents->profile()->GetPrefs(); 190 PrefService* prefs = tab_contents->profile()->GetPrefs();
183 SetupControls(prefs); 191 SetupControls(prefs);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 this, 301 this,
294 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, 302 IDS_DEFAULT_SEARCH_PROMPT_CURRENT,
295 default_short_name); 303 default_short_name);
296 layout->AddView(default_provider_button_); 304 layout->AddView(default_provider_button_);
297 proposed_provider_button_ = CreateProviderChoiceButton( 305 proposed_provider_button_ = CreateProviderChoiceButton(
298 this, 306 this,
299 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, 307 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED,
300 proposed_short_name); 308 proposed_short_name);
301 layout->AddView(proposed_provider_button_); 309 layout->AddView(proposed_provider_button_);
302 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698