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

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: Address Nits 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..0a25eed8ca8ff12914294c6d13ac15b1ef0e4418 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,13 @@ 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);
+
+ // OmniboxView:
+ void SetEmphasis(bool emphasize, const gfx::Range& range) override;
+ 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 +238,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);
};
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698