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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h

Issue 2641003002: Show scheme in black and content in gray for data: protocol urls (Closed)
Patch Set: Only call UpdateSchemeStyle when a scheme is present. 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
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
index 18c18df08bfac0979d2a6ab525ac1e86d0e4c951..fc7ff9efb7dc4e9a7c6029b4429434bd2e785f40 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h
@@ -10,6 +10,7 @@
#include <memory>
+#include "base/auto_reset.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/strings/string16.h"
@@ -32,6 +33,8 @@ class OmniboxViewMac : public OmniboxView,
public:
static SkColor BaseTextColorSkia(bool in_dark_mode);
static NSColor* BaseTextColor(bool in_dark_mode);
+ // Returns a color representing |security_level|, adjusted based on whether
+ // the browser is in Incognito mode.
static NSColor* GetSecureTextColor(
security_state::SecurityLevel security_level,
bool in_dark_mode);
@@ -180,9 +183,12 @@ class OmniboxViewMac : public OmniboxView,
void ApplyTextStyle(NSMutableAttributedString* attributedString);
// Calculates text attributes according to |display_text| and applies them
- // to the given |attributedString| object.
+ // to the given |attributed_string| object.
void ApplyTextAttributes(const base::string16& display_text,
- NSMutableAttributedString* attributedString);
+ NSMutableAttributedString* attributed_string);
+
+ void SetEmphasis(bool emphasize, const gfx::Range& range) override;
Peter Kasting 2017/03/03 02:31:08 Nit: Consider an "// OmniboxView:" header above th
elawrence 2017/03/03 16:07:42 Done.
+ void UpdateSchemeStyle(const gfx::Range& scheme_range) override;
// Return the number of UTF-16 units in the current buffer, excluding the
// suggested text.
@@ -231,6 +237,10 @@ class OmniboxViewMac : public OmniboxView,
// The time when OnBeforeDrawRect() was called.
base::TimeTicks draw_rect_start_time_;
+ // Temporary pointer to the attributed display string, stored as color and
+ // other emphasis attributes are applied by the superclass.
+ NSMutableAttributedString* attributing_display_string_; // weak
+
DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac);
};

Powered by Google App Engine
This is Rietveld 408576698