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

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

Issue 4234004: Fix some UI issues with omnibox extensions in incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 10 years, 1 month 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 | chrome/browser/autocomplete/keyword_provider.cc » ('j') | 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 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;
}
« no previous file with comments | « no previous file | chrome/browser/autocomplete/keyword_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698