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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/ui/tabs/tab_utils.h" | 9 #include "chrome/browser/ui/tabs/tab_utils.h" |
10 #include "ui/views/controls/button/image_button.h" | 10 #include "ui/views/controls/button/image_button.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 TabMediaState showing_media_state() const { | 37 TabMediaState showing_media_state() const { |
38 return showing_media_state_; | 38 return showing_media_state_; |
39 } | 39 } |
40 | 40 |
41 // Updates ImageButton images, starts fade animations, and | 41 // Updates ImageButton images, starts fade animations, and |
42 // activates/deactivates button functionality as appropriate. | 42 // activates/deactivates button functionality as appropriate. |
43 void TransitionToMediaState(TabMediaState next_state); | 43 void TransitionToMediaState(TabMediaState next_state); |
44 | 44 |
45 protected: | 45 protected: |
46 // views::View: | 46 // views::View: |
47 virtual const char* GetClassName() const OVERRIDE; | 47 virtual const char* GetClassName() const override; |
48 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE; | 48 virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) override; |
49 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 49 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; |
50 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 50 virtual void OnPaint(gfx::Canvas* canvas) override; |
51 | 51 |
52 // views::ViewTargeterDelegate | 52 // views::ViewTargeterDelegate |
53 virtual bool DoesIntersectRect(const View* target, | 53 virtual bool DoesIntersectRect(const View* target, |
54 const gfx::Rect& rect) const OVERRIDE; | 54 const gfx::Rect& rect) const override; |
55 | 55 |
56 // views::Button: | 56 // views::Button: |
57 virtual void NotifyClick(const ui::Event& event) OVERRIDE; | 57 virtual void NotifyClick(const ui::Event& event) override; |
58 | 58 |
59 private: | 59 private: |
60 class FadeAnimationDelegate; | 60 class FadeAnimationDelegate; |
61 | 61 |
62 TabMediaState media_state_; | 62 TabMediaState media_state_; |
63 | 63 |
64 // Media indicator fade-in/out animation (i.e., only on show/hide, not a | 64 // Media indicator fade-in/out animation (i.e., only on show/hide, not a |
65 // continuous animation). | 65 // continuous animation). |
66 scoped_ptr<gfx::AnimationDelegate> fade_animation_delegate_; | 66 scoped_ptr<gfx::AnimationDelegate> fade_animation_delegate_; |
67 scoped_ptr<gfx::Animation> fade_animation_; | 67 scoped_ptr<gfx::Animation> fade_animation_; |
68 TabMediaState showing_media_state_; | 68 TabMediaState showing_media_state_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(MediaIndicatorButton); | 70 DISALLOW_COPY_AND_ASSIGN(MediaIndicatorButton); |
71 }; | 71 }; |
72 | 72 |
73 #endif // CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ | 73 #endif // CHROME_BROWSER_UI_VIEWS_TABS_MEDIA_INDICATOR_BUTTON_H_ |
OLD | NEW |