| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_UI_COCOA_TABS_MEDIA_INDICATOR_BUTTON_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_BUTTON_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_BUTTON_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_BUTTON_COCOA_H_ |
| 7 | 7 |
| 8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/ui/tabs/tab_utils.h" | 10 #include "chrome/browser/ui/tabs/tab_utils.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Media indicator fade-in/out animation (i.e., only on show/hide, not a | 37 // Media indicator fade-in/out animation (i.e., only on show/hide, not a |
| 38 // continuous animation). | 38 // continuous animation). |
| 39 scoped_ptr<gfx::AnimationDelegate> fadeAnimationDelegate_; | 39 scoped_ptr<gfx::AnimationDelegate> fadeAnimationDelegate_; |
| 40 scoped_ptr<gfx::Animation> fadeAnimation_; | 40 scoped_ptr<gfx::Animation> fadeAnimation_; |
| 41 TabMediaState showingMediaState_; | 41 TabMediaState showingMediaState_; |
| 42 | 42 |
| 43 // Target and action invoked whenever a fade-in/out animation completes. This | 43 // Target and action invoked whenever a fade-in/out animation completes. This |
| 44 // is used by TabController to layout the TabView after an indicator has | 44 // is used by TabController to layout the TabView after an indicator has |
| 45 // completely faded out. | 45 // completely faded out. |
| 46 __weak id animationDoneTarget_; | 46 id animationDoneTarget_; // weak |
| 47 SEL animationDoneAction_; | 47 SEL animationDoneAction_; |
| 48 | 48 |
| 49 // The image to show when the mouse hovers over the button. | 49 // The image to show when the mouse hovers over the button. |
| 50 base::scoped_nsobject<NSImage> affordanceImage_; | 50 base::scoped_nsobject<NSImage> affordanceImage_; |
| 51 | 51 |
| 52 // Target and action invoked whenever an enabled button is clicked. | 52 // Target and action invoked whenever an enabled button is clicked. |
| 53 __weak id clickTarget_; | 53 id clickTarget_; // weak |
| 54 SEL clickAction_; | 54 SEL clickAction_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 @property(readonly, nonatomic) TabMediaState showingMediaState; | 57 @property(readonly, nonatomic) TabMediaState showingMediaState; |
| 58 | 58 |
| 59 // Initialize a new MediaIndicatorButton in TAB_MEDIA_STATE_NONE (i.e., a | 59 // Initialize a new MediaIndicatorButton in TAB_MEDIA_STATE_NONE (i.e., a |
| 60 // non-active indicator). | 60 // non-active indicator). |
| 61 - (id)init; | 61 - (id)init; |
| 62 | 62 |
| 63 // Updates button images, starts fade animations, and activates/deactivates | 63 // Updates button images, starts fade animations, and activates/deactivates |
| (...skipping 10 matching lines...) Expand all Loading... |
| 74 // weak reference on |target| is held. | 74 // weak reference on |target| is held. |
| 75 - (void)setAnimationDoneTarget:(id)target withAction:(SEL)action; | 75 - (void)setAnimationDoneTarget:(id)target withAction:(SEL)action; |
| 76 | 76 |
| 77 // Request a message be sent to |target| whenever the enabled button has been | 77 // Request a message be sent to |target| whenever the enabled button has been |
| 78 // clicked. A weak reference on |target| is held. | 78 // clicked. A weak reference on |target| is held. |
| 79 - (void)setClickTarget:(id)target withAction:(SEL)action; | 79 - (void)setClickTarget:(id)target withAction:(SEL)action; |
| 80 | 80 |
| 81 @end | 81 @end |
| 82 | 82 |
| 83 #endif // CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_BUTTON_COCOA_H_ | 83 #endif // CHROME_BROWSER_UI_COCOA_TABS_MEDIA_INDICATOR_BUTTON_COCOA_H_ |
| OLD | NEW |