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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.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: Implementation does not depend on having a host and fixed nits. 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_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 2151f1648599605a9bfe6cb82ad5b671c68265c9..0479b67ff278c73ddb2a17b6004da26e36043f77 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -828,13 +828,19 @@ void OmniboxViewViews::EmphasizeURLComponents() {
// And Go system uses.
url_parse::Component scheme, host;
AutocompleteInput::ParseForEmphasizeComponents(text(), &scheme, &host);
- const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0);
- SetColor(location_bar_view_->GetColor(security_level_,
- emphasize ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT));
- if (emphasize) {
- ApplyColor(
- location_bar_view_->GetColor(security_level_, LocationBarView::TEXT),
- ui::Range(host.begin, host.end()));
+ if (model()->CurrentTextIsURL() &&
Peter Kasting 2013/04/04 21:07:05 Nit: Slightly simpler: bool grey_base = model()
Patrick Riordan 2013/04/10 02:00:24 Done.
+ (host.is_nonempty() || toolbar_model()->ShouldGreyOutURL())) {
+ SetColor(location_bar_view_->GetColor(security_level_,
+ LocationBarView::DEEMPHASIZED_TEXT));
+
+ if (host.is_nonempty() && !toolbar_model()->ShouldGreyOutURL()) {
+ ApplyColor(
+ location_bar_view_->GetColor(security_level_, LocationBarView::TEXT),
+ ui::Range(host.begin, host.end()));
+ }
+ } else {
+ SetColor(location_bar_view_->GetColor(security_level_,
+ LocationBarView::TEXT));
}
// Emphasize the scheme for security UI display purposes (if necessary).

Powered by Google App Engine
This is Rietveld 408576698