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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_model.cc

Issue 5511007: Fix a browser crash when typing a disabled extension keyword in an (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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/autocomplete/autocomplete_popup_model.cc
diff --git a/chrome/browser/autocomplete/autocomplete_popup_model.cc b/chrome/browser/autocomplete/autocomplete_popup_model.cc
index 9e969849bf48844389a49d3b1c26c29c09568792..af83a0d78c7b3ce4fcd5c70eb352502101faa0ea 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_model.cc
+++ b/chrome/browser/autocomplete/autocomplete_popup_model.cc
@@ -222,12 +222,13 @@ bool AutocompletePopupModel::GetKeywordForMatch(const AutocompleteMatch& match,
if (!TemplateURL::SupportsReplacement(template_url))
return false;
- // Don't provide a hint if this is an extension keyword not enabled for
- // incognito mode (and if this is an incognito profile).
- if (template_url->IsExtensionKeyword() && profile_->IsOffTheRecord()) {
+ // Don't provide a hint for inactive/disabled extension keywords.
+ if (template_url->IsExtensionKeyword()) {
const Extension* extension = profile_->GetExtensionsService()->
GetExtensionById(template_url->GetExtensionId(), false);
- if (!profile_->GetExtensionsService()->IsIncognitoEnabled(extension))
+ if (!extension ||
+ (profile_->IsOffTheRecord() &&
+ !profile_->GetExtensionsService()->IsIncognitoEnabled(extension)))
return false;
}
« 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