• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_THROBBER_VIEW_H_
6 #define CHROME_BROWSER_UI_COCOA_TABS_THROBBER_VIEW_H_
7 #pragma once
8 
9 #import <Cocoa/Cocoa.h>
10 
11 #include "base/memory/scoped_nsobject.h"
12 
13 @protocol ThrobberDataDelegate;
14 
15 // A class that knows how to draw an animated state to indicate progress.
16 // Creating the class starts the animation, destroying it stops it. There are
17 // two types:
18 //
19 // - Filmstrip: Draws via a sequence of frames in an image. There is no state
20 //   where the class is frozen on an image and not animating. The image needs to
21 //   be made of squares such that the height divides evenly into the width.
22 //
23 // - Toast: Draws an image animating down to the bottom and then another image
24 //   animating up from the bottom. Stops once the animation is complete.
25 
26 @interface ThrobberView : NSView {
27  @private
28   id<ThrobberDataDelegate> dataDelegate_;
29 }
30 
31 // Creates a filmstrip view with |frame| and image |image|.
32 + (id)filmstripThrobberViewWithFrame:(NSRect)frame
33                                image:(NSImage*)image;
34 
35 // Creates a toast view with |frame| and specified images.
36 + (id)toastThrobberViewWithFrame:(NSRect)frame
37                      beforeImage:(NSImage*)beforeImage
38                       afterImage:(NSImage*)afterImage;
39 
40 @end
41 
42 #endif  // CHROME_BROWSER_UI_COCOA_TABS_THROBBER_VIEW_H_
43