1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_VIEW_H_
6 #define CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_VIEW_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/ui/tabs/tab_utils.h"
13 class MediaIndicatorViewAnimationDelegate
;
19 @interface MediaIndicatorView
: NSImageView
{
21 TabMediaState mediaState_
;
22 scoped_ptr
<MediaIndicatorViewAnimationDelegate
> delegate_
;
23 scoped_ptr
<gfx::Animation
> animation_
;
24 TabMediaState animatingMediaState_
;
27 @
property(readonly
, nonatomic
) TabMediaState mediaState
;
28 @
property(readonly
, nonatomic
) TabMediaState animatingMediaState
;
30 // Initialize a new MediaIndicatorView in TAB_MEDIA_STATE_NONE (i.e., a
31 // non-active indicator).
34 // Starts the animation to transition the indicator to the new |mediaState|.
35 - (void)updateIndicator
:(TabMediaState
)mediaState
;
37 // Register a callback to be invoked whenever the animation completes.
38 - (void)setAnimationDoneCallbackObject
:(id
)anObject withSelector
:(SEL
)selector
;
42 @interface
MediaIndicatorView(TestingAPI
)
43 // Turns off animations for logic testing.
44 - (void)disableAnimations
;
47 #endif // CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_VIEW_H_