Home | History | Annotate | Download | only in tabs
      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 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 @protocol ThrobberDataDelegate;
     11 
     12 // A class that knows how to draw an animated state to indicate progress.
     13 // Creating the class starts the animation, destroying it stops it. There are
     14 // two types:
     15 //
     16 // - Filmstrip: Draws via a sequence of frames in an image. There is no state
     17 //   where the class is frozen on an image and not animating. The image needs to
     18 //   be made of squares such that the height divides evenly into the width.
     19 //
     20 // - Toast: Draws an image animating down to the bottom and then another image
     21 //   animating up from the bottom. Stops once the animation is complete.
     22 
     23 @interface ThrobberView : NSView {
     24  @private
     25   id<ThrobberDataDelegate> dataDelegate_;
     26 }
     27 
     28 // Creates a filmstrip view with |frame| and image |image|.
     29 + (id)filmstripThrobberViewWithFrame:(NSRect)frame
     30                                image:(NSImage*)image;
     31 
     32 // Creates a toast view with |frame| and specified images.
     33 + (id)toastThrobberViewWithFrame:(NSRect)frame
     34                      beforeImage:(NSImage*)beforeImage
     35                       afterImage:(NSImage*)afterImage;
     36 
     37 @end
     38 
     39 #endif  // CHROME_BROWSER_UI_COCOA_TABS_THROBBER_VIEW_H_
     40