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 774acd0811b5c2d4c2e9e90dc8404510ee6a54a4..a14d19fb9c31dbbe38c5c5fa2582016e78585614 100644 |
--- a/chrome/browser/autocomplete/autocomplete_popup_model.cc |
+++ b/chrome/browser/autocomplete/autocomplete_popup_model.cc |
@@ -221,6 +221,15 @@ 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()) { |
+ const Extension* extension = profile_->GetExtensionsService()-> |
+ GetExtensionById(template_url->GetExtensionId(), false); |
+ if (!profile_->GetExtensionsService()->IsIncognitoEnabled(extension)) |
+ return false; |
+ } |
+ |
keyword->assign(keyword_hint); |
return true; |
} |