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

Issue 16098012: [Mac] Reimplement HoverButton and HoverImageButton using NSButton.state.

Created:
7 years, 6 months ago by Robert Sesek
Modified:
7 years, 6 months ago
Reviewers:
Nico, sail
CC:
chromium-reviews, sail+watch_chromium.org
Visibility:
Public.

Description

[Mac] Reimplement HoverButton and HoverImageButton using NSButton.state. Rather than manually tracking button state using -mouseDown:, just use the button's already tracked state. This means that changing the button type, to e.g. NSToggleButton, results in the correct image being displayed when "pressed" on. BUG=none TEST=Tab close buttons still work (show right states, animate out).

Patch Set 1 #

Total comments: 2

Patch Set 2 : nonatomic, assign #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -67 lines) Patch
M chrome/browser/ui/cocoa/hover_close_button.mm View 1 chunk +18 lines, -19 lines 2 comments Download
M ui/base/cocoa/hover_button.h View 1 1 chunk +5 lines, -3 lines 0 comments Download
M ui/base/cocoa/hover_button.mm View 4 chunks +17 lines, -29 lines 0 comments Download
M ui/base/cocoa/hover_image_button.mm View 1 chunk +10 lines, -11 lines 0 comments Download
M ui/message_center/cocoa/tray_view_controller.mm View 2 chunks +1 line, -5 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Robert Sesek
7 years, 6 months ago (2013-06-03 20:16:09 UTC) #1
Robert Sesek
ping
7 years, 6 months ago (2013-06-04 18:36:41 UTC) #2
sail
LGTM, looks awesome https://codereview.chromium.org/16098012/diff/1/ui/base/cocoa/hover_button.h File ui/base/cocoa/hover_button.h (right): https://codereview.chromium.org/16098012/diff/1/ui/base/cocoa/hover_button.h#newcode34 ui/base/cocoa/hover_button.h:34: @property(nonatomic) BOOL isMouseInside; nonatomic, assign?
7 years, 6 months ago (2013-06-05 20:06:22 UTC) #3
Robert Sesek
+thakis for OWNERS https://codereview.chromium.org/16098012/diff/1/ui/base/cocoa/hover_button.h File ui/base/cocoa/hover_button.h (right): https://codereview.chromium.org/16098012/diff/1/ui/base/cocoa/hover_button.h#newcode34 ui/base/cocoa/hover_button.h:34: @property(nonatomic) BOOL isMouseInside; On 2013/06/05 20:06:22, ...
7 years, 6 months ago (2013-06-05 20:23:21 UTC) #4
Nico
7 years, 6 months ago (2013-06-06 19:25:43 UTC) #5
gah rietveld

https://codereview.chromium.org/16098012/diff/10001/chrome/browser/ui/cocoa/h...
File chrome/browser/ui/cocoa/hover_close_button.mm (right):

https://codereview.chromium.org/16098012/diff/10001/chrome/browser/ui/cocoa/h...
chrome/browser/ui/cocoa/hover_close_button.mm:179: -
(void)mouseExited:(NSEvent*)event {
This is only called if showsBorderOnlyWhileMouseInside is set on the button,
right?

https://codereview.chromium.org/16098012/diff/10001/chrome/browser/ui/cocoa/h...
chrome/browser/ui/cocoa/hover_close_button.mm:179: -
(void)mouseExited:(NSEvent*)event {
This is only called if showsBorderOnlyWhileMouseInside is YES for the button,
right? Is that an issue?

Powered by Google App Engine
This is Rietveld 408576698