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

Side by Side 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: Not hacky anymore 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 // should emphasize. To check for a URL, rather than using the type returned 795 // should emphasize. To check for a URL, rather than using the type returned
796 // by Parse(), ask the model, which will check the desired page transition for 796 // by Parse(), ask the model, which will check the desired page transition for
797 // this input. This can tell us whether an UNKNOWN input string is going to 797 // this input. This can tell us whether an UNKNOWN input string is going to
798 // be treated as a search or a navigation, and is the same method the Paste 798 // be treated as a search or a navigation, and is the same method the Paste
799 // And Go system uses. 799 // And Go system uses.
800 url_parse::Component scheme, host; 800 url_parse::Component scheme, host;
801 AutocompleteInput::ParseForEmphasizeComponents(text(), &scheme, &host); 801 AutocompleteInput::ParseForEmphasizeComponents(text(), &scheme, &host);
802 const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0); 802 const bool emphasize = model()->CurrentTextIsURL() && (host.len > 0);
803 SetColor(location_bar_view_->GetColor(security_level_, 803 SetColor(location_bar_view_->GetColor(security_level_,
804 emphasize ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT)); 804 emphasize ? LocationBarView::DEEMPHASIZED_TEXT : LocationBarView::TEXT));
805 if (emphasize) { 805 if (emphasize && !toolbar_model()->ShouldNotEmphasizeHost()) {
806 ApplyColor( 806 ApplyColor(
807 location_bar_view_->GetColor(security_level_, LocationBarView::TEXT), 807 location_bar_view_->GetColor(security_level_, LocationBarView::TEXT),
808 ui::Range(host.begin, host.end())); 808 ui::Range(host.begin, host.end()));
809 } 809 }
810 810
811 // Emphasize the scheme for security UI display purposes (if necessary). 811 // Emphasize the scheme for security UI display purposes (if necessary).
812 // Note that we check CurrentTextIsURL() because if we're replacing search 812 // Note that we check CurrentTextIsURL() because if we're replacing search
813 // URLs with search terms, we may have a non-URL even when the user is not 813 // URLs with search terms, we may have a non-URL even when the user is not
814 // editing; and in some cases, e.g. for "site:foo.com" searches, the parser 814 // editing; and in some cases, e.g. for "site:foo.com" searches, the parser
815 // may have incorrectly identified a qualifier as a scheme. 815 // may have incorrectly identified a qualifier as a scheme.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 const string16 text(GetClipboardText()); 847 const string16 text(GetClipboardText());
848 if (!text.empty()) { 848 if (!text.empty()) {
849 // Record this paste, so we can do different behavior. 849 // Record this paste, so we can do different behavior.
850 model()->on_paste(); 850 model()->on_paste();
851 // Force a Paste operation to trigger the text_changed code in 851 // Force a Paste operation to trigger the text_changed code in
852 // OnAfterPossibleChange(), even if identical contents are pasted. 852 // OnAfterPossibleChange(), even if identical contents are pasted.
853 text_before_change_.clear(); 853 text_before_change_.clear();
854 ReplaceSelection(text); 854 ReplaceSelection(text);
855 } 855 }
856 } 856 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698