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 #import "chrome/browser/ui/cocoa/tabs/throbber_view.h" | 5 #import "chrome/browser/ui/cocoa/tabs/throbber_view.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // Draw the current frame into the current graphics context. | 23 // Draw the current frame into the current graphics context. |
24 - (void)drawFrameInRect:(NSRect)rect; | 24 - (void)drawFrameInRect:(NSRect)rect; |
25 | 25 |
26 // Update the frame counter. | 26 // Update the frame counter. |
27 - (void)advanceFrame; | 27 - (void)advanceFrame; |
28 @end | 28 @end |
29 | 29 |
30 @interface ThrobberFilmstripDelegate : NSObject | 30 @interface ThrobberFilmstripDelegate : NSObject |
31 <ThrobberDataDelegate> { | 31 <ThrobberDataDelegate> { |
32 scoped_nsobject<NSImage> image_; | 32 base::scoped_nsobject<NSImage> image_; |
33 unsigned int numFrames_; // Number of frames in this animation. | 33 unsigned int numFrames_; // Number of frames in this animation. |
34 unsigned int animationFrame_; // Current frame of the animation, | 34 unsigned int animationFrame_; // Current frame of the animation, |
35 // [0..numFrames_) | 35 // [0..numFrames_) |
36 } | 36 } |
37 | 37 |
38 - (id)initWithImage:(NSImage*)image; | 38 - (id)initWithImage:(NSImage*)image; |
39 | 39 |
40 @end | 40 @end |
41 | 41 |
42 @implementation ThrobberFilmstripDelegate | 42 @implementation ThrobberFilmstripDelegate |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 - (void)advanceFrame { | 78 - (void)advanceFrame { |
79 animationFrame_ = ++animationFrame_ % numFrames_; | 79 animationFrame_ = ++animationFrame_ % numFrames_; |
80 } | 80 } |
81 | 81 |
82 @end | 82 @end |
83 | 83 |
84 @interface ThrobberToastDelegate : NSObject | 84 @interface ThrobberToastDelegate : NSObject |
85 <ThrobberDataDelegate> { | 85 <ThrobberDataDelegate> { |
86 scoped_nsobject<NSImage> image1_; | 86 base::scoped_nsobject<NSImage> image1_; |
87 scoped_nsobject<NSImage> image2_; | 87 base::scoped_nsobject<NSImage> image2_; |
88 NSSize image1Size_; | 88 NSSize image1Size_; |
89 NSSize image2Size_; | 89 NSSize image2Size_; |
90 int animationFrame_; // Current frame of the animation, | 90 int animationFrame_; // Current frame of the animation, |
91 } | 91 } |
92 | 92 |
93 - (id)initWithImage1:(NSImage*)image1 image2:(NSImage*)image2; | 93 - (id)initWithImage1:(NSImage*)image1 image2:(NSImage*)image2; |
94 | 94 |
95 @end | 95 @end |
96 | 96 |
97 @implementation ThrobberToastDelegate | 97 @implementation ThrobberToastDelegate |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 [[ThrobberTimer sharedThrobberTimer] removeThrobber:self]; | 363 [[ThrobberTimer sharedThrobberTimer] removeThrobber:self]; |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 // Overridden to draw the appropriate frame in the image strip. | 367 // Overridden to draw the appropriate frame in the image strip. |
368 - (void)drawRect:(NSRect)rect { | 368 - (void)drawRect:(NSRect)rect { |
369 [dataDelegate_ drawFrameInRect:[self bounds]]; | 369 [dataDelegate_ drawFrameInRect:[self bounds]]; |
370 } | 370 } |
371 | 371 |
372 @end | 372 @end |
OLD | NEW |