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

Unified Diff: components/omnibox/browser/omnibox_view.h

Issue 2641003002: Show scheme in black and content in gray for data: protocol urls (Closed)
Patch Set: Move misplaced #include to mm files Created 3 years, 10 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
« no previous file with comments | « components/omnibox/browser/omnibox_edit_unittest.cc ('k') | components/omnibox/browser/omnibox_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/omnibox_view.h
diff --git a/components/omnibox/browser/omnibox_view.h b/components/omnibox/browser/omnibox_view.h
index ba019537e2f831b66a4ba7a6c8621656e82b2f87..8546cb0db170a1b2ae1bbdf7bcecd7738a82ac9c 100644
--- a/components/omnibox/browser/omnibox_view.h
+++ b/components/omnibox/browser/omnibox_view.h
@@ -23,6 +23,7 @@
#include "components/omnibox/browser/autocomplete_match.h"
#include "ui/base/window_open_disposition.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/range/range.h"
class GURL;
class OmniboxClient;
@@ -248,6 +249,10 @@ class OmniboxView {
// Internally invoked whenever the text changes in some way.
virtual void TextChanged();
+ // Returns whether the current text in the model represents a URL. Provided
+ // to allow tests to override the result.
+ virtual bool CurrentTextIsURL();
+
// Return the number of characters in the current buffer. The name
// |GetTextLength| can't be used as the Windows override of this class
// inherits from a class that defines a method with that name.
@@ -259,6 +264,24 @@ class OmniboxView {
OmniboxEditController* controller() { return controller_; }
const OmniboxEditController* controller() const { return controller_; }
+ // Marks part (or, if |range| is invalid, all) of the current text as
+ // emphasized or de-emphasized, by changing its color.
+ virtual void SetEmphasis(bool emphasize, const gfx::Range& range) = 0;
+
+ // Sets the color and strikethrough state for |range|, which represents the
+ // current scheme, based on the current security state. Schemes are displayed
+ // in different ways for different security levels.
+ virtual void UpdateSchemeStyle(const gfx::Range& range) = 0;
+
+ // Parses |display_text|, then invokes SetEmphasis() and UpdateSchemeStyle()
+ // appropriately. If the text is a query string, there is no scheme, and
+ // everything is emphasized equally, whereas for URLs the scheme may be styled
+ // based on the current security state, with parts of the URL de-emphasized to
+ // draw attention to whatever best represents the "identity" of the current
+ // URL.
+ void UpdateTextStyle(const base::string16& display_text,
+ const AutocompleteSchemeClassifier& classifier);
+
private:
friend class OmniboxViewMacTest;
« no previous file with comments | « components/omnibox/browser/omnibox_edit_unittest.cc ('k') | components/omnibox/browser/omnibox_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698