Chromium Code Reviews| 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_; |