summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 17:49:42 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-24 17:49:42 +0000
commita7681f2024d72bc36a6e6bcfc2666e3749616357 (patch)
tree4a4dd8ffe5db8f7f66c03589054b8e596669dc33 /chrome
parentfa81610a6f208e388f43605fc71da063674a7de5 (diff)
downloadchromium_src-a7681f2024d72bc36a6e6bcfc2666e3749616357.zip
chromium_src-a7681f2024d72bc36a6e6bcfc2666e3749616357.tar.gz
chromium_src-a7681f2024d72bc36a6e6bcfc2666e3749616357.tar.bz2
Fixes crash in new tab page when searching from a field other than the
first. BUG=8583 TEST=see bug Review URL: http://codereview.chromium.org/42566 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index d3183d5..3dd58fc 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -544,10 +544,6 @@ void TemplateURLHandler::HandleDoSearch(const Value* content) {
TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring());
if (url.is_valid()) {
- // Load the URL.
- dom_ui_->web_contents()->OpenURL(url, GURL(), CURRENT_TAB,
- PageTransition::LINK);
-
// Record the user action
std::vector<const TemplateURL*> urls =
template_url_model_->GetTemplateURLs();
@@ -572,6 +568,12 @@ void TemplateURLHandler::HandleDoSearch(const Value* content) {
item_number++;
}
+
+ // Load the URL.
+ dom_ui_->web_contents()->OpenURL(url, GURL(), CURRENT_TAB,
+ PageTransition::LINK);
+ // We've been deleted.
+ return;
}
}