| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool DoesIntersectRect(const View* target, | 70 bool DoesIntersectRect(const View* target, |
| 71 const gfx::Rect& rect) const override; | 71 const gfx::Rect& rect) const override; |
| 72 | 72 |
| 73 // views::Button: | 73 // views::Button: |
| 74 void NotifyClick(const ui::Event& event) override; | 74 void NotifyClick(const ui::Event& event) override; |
| 75 | 75 |
| 76 // views::CustomButton: | 76 // views::CustomButton: |
| 77 bool IsTriggerableEvent(const ui::Event& event) override; | 77 bool IsTriggerableEvent(const ui::Event& event) override; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 friend class MediaIndicatorButtonTest; |
| 80 class FadeAnimationDelegate; | 81 class FadeAnimationDelegate; |
| 81 | 82 |
| 82 // Returns the tab (parent view) of this MediaIndicatorButton. | 83 // Returns the tab (parent view) of this MediaIndicatorButton. |
| 83 Tab* GetTab() const; | 84 Tab* GetTab() const; |
| 84 | 85 |
| 85 // Resets the images to display on the button to reflect |state| and the | 86 // Resets the images to display on the button to reflect |state| and the |
| 86 // parent tab's button color. Should be called when either of these changes. | 87 // parent tab's button color. Should be called when either of these changes. |
| 87 void ResetImages(TabMediaState state); | 88 void ResetImages(TabMediaState state); |
| 88 | 89 |
| 89 Tab* const parent_tab_; | 90 Tab* const parent_tab_; |
| 90 | 91 |
| 91 TabMediaState media_state_; | 92 TabMediaState media_state_; |
| 92 | 93 |
| 93 // Media indicator fade-in/out animation (i.e., only on show/hide, not a | 94 // Media indicator fade-in/out animation (i.e., only on show/hide, not a |
| 94 // continuous animation). | 95 // continuous animation). |
| 95 scoped_ptr<gfx::AnimationDelegate> fade_animation_delegate_; | 96 scoped_ptr<gfx::AnimationDelegate> fade_animation_delegate_; |
| 96 scoped_ptr<gfx::Animation> fade_animation_; | 97 scoped_ptr<gfx::Animation> fade_animation_; |
| 97 TabMediaState showing_media_state_; | 98 TabMediaState showing_media_state_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(MediaIndicatorButton); | 100 DISALLOW_COPY_AND_ASSIGN(MediaIndicatorButton); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 #endif // CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ | 103 #endif // CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ |
| OLD | NEW |