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

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: Fixed mac typos and fixed unit test Created 7 years, 8 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 9c822f70ad2a41437d211818154bd2b0c9c5b17c..e2f4142ef095fe3b18e1cd8ced992f67f02563c4 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
#include "content/public/browser/web_contents.h"
+#include "extensions/common/constants.h"
#include "googleurl/src/gurl.h"
#include "grit/app_locale_settings.h"
#include "grit/generated_resources.h"
@@ -849,10 +850,14 @@ 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) {
+ bool grey_out_url = text().substr(scheme.begin, scheme.len) ==
+ UTF8ToUTF16(extensions::kExtensionScheme);
+ bool grey_base = model()->CurrentTextIsURL() &&
+ (host.is_nonempty() || grey_out_url);
+ SetColor(location_bar_view_->GetColor(
+ security_level_,
+ grey_base ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT));
+ if (grey_base && !grey_out_url) {
ApplyColor(
location_bar_view_->GetColor(security_level_, LocationBarView::TEXT),
ui::Range(host.begin, host.end()));
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_unittest.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698