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 11de3a008fb484d72b9f3dc43ce5b33d1ec73fb7..ddc8d8d66aa82989e3ade21234ca3b2e843d707c 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h |
| +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h |
| @@ -25,7 +25,9 @@ |
| // Decorations are more like Cocoa cells, except implemented in C++ to |
| // allow more similarity to the other platform implementations. |
| -enum class LocationBarDecorationState { NORMAL, HOVER, PRESSED }; |
| +// This enum class represents the state of the decoration's interactions |
| +// with the mouse. |
| +enum class DecorationMouseState { NONE, HOVER, PRESSED }; |
| class LocationBarDecoration { |
| public: |
| @@ -102,6 +104,10 @@ class LocationBarDecoration { |
| void OnMouseEntered(); |
| void OnMouseExited(); |
| + // Sets the active state of the decoration. If the state has changed, call |
| + // UpdateDecorationState(). |
| + void SetActive(bool active); |
| + |
| // Called to get the right-click menu, return |nil| for no menu. |
| virtual NSMenu* GetMenu(); |
| @@ -134,7 +140,9 @@ class LocationBarDecoration { |
| // to the private DecorationAccessibilityView helper class. |
| void OnAccessibilityViewAction(); |
| - LocationBarDecorationState state() { return state_; } |
| + DecorationMouseState state() const { return state_; } |
| + |
| + bool active() const { return active_; } |
| // Width returned by |GetWidthForSpace()| when the item should be |
| // omitted for this width; |
| @@ -162,6 +170,10 @@ class LocationBarDecoration { |
| void UpdateDecorationState(); |
| bool visible_ = false; |
| + |
| + // True if the decoration is active. |
| + bool active_ = false; |
| + |
| base::scoped_nsobject<NSView> accessibility_view_; |
| // The decoration's tracking area. Only set if the decoration accepts a mouse |
| @@ -176,7 +188,7 @@ class LocationBarDecoration { |
| base::scoped_nsobject<DecorationMouseTrackingDelegate> tracking_delegate_; |
| // The state of the decoration. |
| - LocationBarDecorationState state_; |
| + DecorationMouseState state_; |
|
Robert Sesek
2016/11/28 22:46:59
Can you do initialization here, too?
spqchan
2016/11/29 17:34:49
Done.
|
| DISALLOW_COPY_AND_ASSIGN(LocationBarDecoration); |
| }; |