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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 12463042: Shows chrome-extension urls and greys out the whole url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the correct extra newline Created 7 years, 9 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
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index 94533b0969e933dbde863f03b6559680afb32522..5a2d308927bc94bba7fab6ce02d7b237acccbaf4 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -2463,7 +2463,8 @@ void OmniboxViewWin::EmphasizeURLComponents() {
// this input. This can tell us whether an UNKNOWN input string is going to
// be treated as a search or a navigation, and is the same method the Paste
// And Go system uses.
- url_parse::Component scheme, host;
+ url_parse::Component scheme;
+ url_parse::Component host;
AutocompleteInput::ParseForEmphasizeComponents(GetText(), &scheme, &host);
const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0);
@@ -2472,7 +2473,8 @@ void OmniboxViewWin::EmphasizeURLComponents() {
cf.dwMask = CFM_COLOR;
// If we're going to emphasize parts of the text, then the baseline state
// should be "de-emphasized". If not, then everything should be rendered in
- // the standard text color.
+ // the standard text color. If we should grey out the entire text then
+ // emphasize is set, but toolbar_model()->ShouldGreyOutURL() is also set.
cf.crTextColor = skia::SkColorToCOLORREF(parent_view_->GetColor(
security_level_,
emphasize ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT));
@@ -2482,8 +2484,9 @@ void OmniboxViewWin::EmphasizeURLComponents() {
SelectAll(false);
SetSelectionCharFormat(cf);
- if (emphasize) {
- // We've found a host name, give it more emphasis.
+ if (emphasize && !toolbar_model()->ShouldGreyOutURL()) {
+ // We've found a host name that we should provide emphasis, so
Devlin 2013/04/01 20:35:28 grammatical error; maybe "We've found a non-intern
Patrick Riordan 2013/04/03 00:19:00 As of this patch its only extension host names tha
+ // emphasize it.
cf.crTextColor = skia::SkColorToCOLORREF(parent_view_->GetColor(
security_level_, LocationBarView::TEXT));
SetSelection(host.begin, host.end());

Powered by Google App Engine
This is Rietveld 408576698