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

Unified Diff: chrome/browser/cocoa/gradient_button_cell.h

Issue 2805099: Pulse new bookmarks (as triggered by bookmark bubble). If not possible, ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « chrome/browser/cocoa/bookmark_button.mm ('k') | chrome/browser/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/gradient_button_cell.h
===================================================================
--- chrome/browser/cocoa/gradient_button_cell.h (revision 53704)
+++ chrome/browser/cocoa/gradient_button_cell.h (working copy)
@@ -31,6 +31,23 @@
};
typedef NSInteger ButtonType;
+namespace gradient_button_cell {
+
+// Pulsing state for this button.
+typedef enum {
+ // Stable states.
+ kPulsedOn,
+ kPulsedOff,
+ // In motion which will end in a stable state.
+ kPulsingOn,
+ kPulsingOff,
+ // In continuous motion.
+ kPulsingContinuous,
+} PulseState;
+
+};
+
+
@interface GradientButtonCell : NSButtonCell {
@private
// Custom drawing means we need to perform our own mouse tracking if
@@ -41,6 +58,9 @@
CGFloat hoverAlpha_; // 0-1. Controls the alpha during mouse hover
NSTimeInterval lastHoverUpdate_;
scoped_nsobject<NSGradient> gradient_;
+ gradient_button_cell::PulseState pulseState_;
+ CGFloat pulseMultiplier_; // for selecting pulse direction when continuous.
+ CGFloat outerStrokeAlphaMult_; // For pulsing.
scoped_nsobject<NSImage> overlayImage_;
}
@@ -67,15 +87,33 @@
- (NSBezierPath*)clipPathForFrame:(NSRect)cellFrame
inView:(NSView*)controlView;
+// Turn on or off continuous pulsing. When turning off continuous
+// pulsing, leave our pulse state in the correct ending position for
+// our isMouseInside_ property. Public since it's called from the
+// bookmark bubble.
+- (void)setIsContinuousPulsing:(BOOL)continuous;
+
+// Returns continuous pulse state.
+- (BOOL)isContinuousPulsing;
+
+// Safely stop continuous pulsing by turning off all timers.
+// May leave the cell in an odd state.
+// Needed by an owning control's dealloc routine.
+- (void)safelyStopPulsing;
+
@property(assign, nonatomic) CGFloat hoverAlpha;
// An image that will be drawn after the normal content of the button cell,
// overlaying it. Never themed.
@property(retain, nonatomic) NSImage* overlayImage;
+
@end
@interface GradientButtonCell(TestingAPI)
- (BOOL)isMouseInside;
+- (BOOL)pulsing;
+- (gradient_button_cell::PulseState)pulseState;
+- (void)setPulseState:(gradient_button_cell::PulseState)pstate;
@end
#endif // CHROME_BROWSER_COCOA_GRADIENT_BUTTON_CELL_H_
« no previous file with comments | « chrome/browser/cocoa/bookmark_button.mm ('k') | chrome/browser/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698