#include "url/gurl.h"
class StatusBubbleMacTest;
+@class StatusBubbleWindow;
class StatusBubbleMac : public StatusBubble {
public:
// call even when the status bubble does not exist.
void SwitchParentWindow(NSWindow* parent);
- // Delegate method called when a fade-in or fade-out transition has
- // completed. This is public so that it may be visible to the CAAnimation
- // delegate, which is an Objective-C object.
- void AnimationDidStop(CAAnimation* animation, bool finished);
-
// Expand the bubble to fit a URL too long for the standard bubble size.
void ExpandBubble();
// reverse a transition before it has completed.
void Fade(bool show);
+ // Starts an animation of the bubble window to a specific alpha value over a
+ // specific period of time.
+ void AnimateWindowAlpha(CGFloat alpha, NSTimeInterval duration);
+
+ // Method called from the completion callbacks when a fade-in or fade-out
+ // transition has completed.
+ void AnimationDidStop();
+
// One-shot timer operations to manage the delays associated with the
// kBubbleShowingTimer and kBubbleHidingTimer states. StartTimer and
// TimerFired must be called from one of these states. StartTimer may be
// for the given mouse position if necessary. Protected for use in tests.
void SetFrameAvoidingMouse(NSRect window_frame, const gfx::Point& mouse_pos);
- // The timer factory used for show and hide delay timers.
+ // The factory used to generate weak pointers for the show and hide delay
+ // timers.
base::WeakPtrFactory<StatusBubbleMac> timer_factory_;
- // The timer factory used for the expansion delay timer.
+ // The factory used to generate weak pointers for the expansion delay timer.
base::WeakPtrFactory<StatusBubbleMac> expand_timer_factory_;
+ // The factory used to generate weak pointers for the CAAnimation completion
+ // handlers.
+ base::WeakPtrFactory<StatusBubbleMac> completion_handler_factory_;
+
// Calculate the appropriate frame for the status bubble window. If
// |expanded_width|, use entire width of parent frame.
NSRect CalculateWindowFrame(bool expanded_width);
id delegate_; // WEAK
// The window we own.
- NSWindow* window_;
+ StatusBubbleWindow* window_;
// The status text we want to display when there are no URLs to display.
NSString* status_text_;