| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_THROBBER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_COCOA_THROBBER_VIEW_H_ |
| 6 #define CHROME_BROWSER_COCOA_THROBBER_VIEW_H_ | 6 #define CHROME_BROWSER_COCOA_THROBBER_VIEW_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
| 11 | 11 |
| 12 @class TimerTarget; | 12 @class TimerTarget; |
| 13 | 13 |
| 14 // A class that knows how to draw an animated state to indicate progress. | 14 // A class that knows how to draw an animated state to indicate progress. |
| 15 // Currently draws via a sequence of frames in an image, but may ultimately be | 15 // Currently draws via a sequence of frames in an image, but may ultimately be |
| 16 // written to render paths that are rotated around a center origin. Creating | 16 // written to render paths that are rotated around a center origin. Creating |
| 17 // the class starts the animation, destroying it stops it. There is no state | 17 // the class starts the animation, destroying it stops it. There is no state |
| 18 // where the class is frozen on an image and not animating. | 18 // where the class is frozen on an image and not animating. |
| 19 | 19 |
| 20 @interface ThrobberView : NSView { | 20 @interface ThrobberView : NSView { |
| 21 @private | 21 @private |
| 22 scoped_nsobject<NSImage> image_; | 22 scoped_nsobject<CIImage> image_; |
| 23 scoped_nsobject<TimerTarget> target_; // Target of animation timer. | 23 scoped_nsobject<TimerTarget> target_; // Target of animation timer. |
| 24 NSTimer* timer_; // Animation timer. Weak, owned by runloop. | 24 NSTimer* timer_; // Animation timer. Weak, owned by runloop. |
| 25 unsigned int numFrames_; // Number of frames in this animation. | 25 unsigned int numFrames_; // Number of frames in this animation. |
| 26 unsigned int animationFrame_; // Current frame of the animation, | 26 unsigned int animationFrame_; // Current frame of the animation, |
| 27 // [0..numFrames_) | 27 // [0..numFrames_) |
| 28 } | 28 } |
| 29 | 29 |
| 30 // Creates the view with |frame| and the image strip desginated by |image|. The | 30 // Creates the view with |frame| and the image strip desginated by |image|. The |
| 31 // image needs to be made of squares such that the height divides evently into | 31 // image needs to be made of squares such that the height divides evently into |
| 32 // the width. Takes ownership of |image|. | 32 // the width. Takes ownership of |image|. |
| 33 - (id)initWithFrame:(NSRect)frame image:(NSImage*)image; | 33 - (id)initWithFrame:(NSRect)frame image:(NSImage*)image; |
| 34 | 34 |
| 35 @end | 35 @end |
| 36 | 36 |
| 37 #endif // CHROME_BROWSER_COCOA_THROBBER_VIEW_H_ | 37 #endif // CHROME_BROWSER_COCOA_THROBBER_VIEW_H_ |
| OLD | NEW |