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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 288073002: Omnibox: Fix Crash by Setting Provider Type for SearchTermReplacement Queries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add dcheck Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 2e7eb9f37076768bdf1ecc58ba9db04ee6b29221..9ffa6d708d88c3b6590ced7031b93e4287634c36 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -715,14 +715,14 @@ void OmniboxEditModel::OpenMatch(AutocompleteMatch match,
base::TimeDelta elapsed_time_since_last_change_to_default_match(
now - autocomplete_controller()->last_time_default_match_changed());
+ DCHECK(match.provider);
// These elapsed times don't really make sense for ZeroSuggest matches
// (because the user does not modify the omnibox for ZeroSuggest), so for
// those we set the elapsed times to something that will be ignored by
// metrics_log.cc. They also don't necessarily make sense if the omnibox
// dropdown is closed or the user used a paste-and-go action. (In most
// cases when this happens, the user never modified the omnibox.)
- if ((match.provider &&
- (match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST)) ||
+ if ((match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST) ||
!popup_model()->IsOpen() || !pasted_text.empty()) {
const base::TimeDelta default_time_delta =
base::TimeDelta::FromMilliseconds(-1);
@@ -1318,6 +1318,7 @@ void OmniboxEditModel::GetInfoForCurrentText(AutocompleteMatch* match,
// SearchProvider::CreateSearchSuggestion(), since the user may be in a
// non-default search mode such as image search.
match->type = AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED;
+ match->provider = autocomplete_controller()->search_provider();
match->destination_url =
delegate_->GetNavigationController().GetVisibleEntry()->GetURL();
match->transition = content::PAGE_TRANSITION_RELOAD;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698