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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h

Issue 1821823004: [Mac][Material Design] Update Omnibox dropdown on Mac to MD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
index dd405a8892dbe0e104054e482a7b985f367ff443..cf2f76b85749c5e7a477967d371339604c2db10a 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
@@ -8,6 +8,8 @@
#import <Cocoa/Cocoa.h>
#include "base/macros.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/gfx/vector_icons_public.h"
// Base class for decorations at the left and right of the location
// bar. For instance, the location icon.
@@ -88,6 +90,9 @@ class LocationBarDecoration {
// The return value is in the same coordinate system as |frame|.
virtual NSPoint GetBubblePointInFrame(NSRect frame);
+ // Gets the Material Design vector-based icon.
+ NSImage* GetMaterialIcon(bool location_bar_is_dark);
tapted 2016/04/28 23:57:51 nit: these methods can all be const methods (GetF
shrike 2016/04/29 18:47:51 Done.
+
static void DrawLabel(NSString* label,
NSDictionary* attributes,
const NSRect& frame);
@@ -100,6 +105,17 @@ class LocationBarDecoration {
// omitted for this width;
static const CGFloat kOmittedWidth;
+ protected:
+ // Gets the color used to draw the Material Design icon. The default
+ // implementation satisfies most cases - few subclasses should need to
+ // override.
+ virtual SkColor GetMaterialIconColor(bool location_bar_is_dark);
+
+ // Gets the id of the decoration's Material Design vector icon. Subclasses
+ // should override to return the correct id. Not an abstract method because
+ // some decorations are assigned their icon (vs. creating it themselves).
+ virtual gfx::VectorIconId GetMaterialVectorIconId();
+
private:
bool visible_;

Powered by Google App Engine
This is Rietveld 408576698