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; |