| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_TAB_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 11 | 11 |
| 12 class SkBitmap; | 12 namespace gfx { |
| 13 class ImageSkia; |
| 14 } |
| 13 | 15 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 15 // | 17 // |
| 16 // A view to display a tab favicon or a throbber. | 18 // A view to display a tab favicon or a throbber. |
| 17 // | 19 // |
| 18 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
| 19 class TabIconView : public views::View { | 21 class TabIconView : public views::View { |
| 20 public: | 22 public: |
| 21 // Classes implement this interface to provide state for the TabIconView. | 23 // Classes implement this interface to provide state for the TabIconView. |
| 22 class TabIconViewModel { | 24 class TabIconViewModel { |
| 23 public: | 25 public: |
| 24 // Returns true if the TabIconView should show a loading animation. | 26 // Returns true if the TabIconView should show a loading animation. |
| 25 virtual bool ShouldTabIconViewAnimate() const = 0; | 27 virtual bool ShouldTabIconViewAnimate() const = 0; |
| 26 | 28 |
| 27 // Returns the favicon to display in the icon view | 29 // Returns the favicon to display in the icon view |
| 28 virtual SkBitmap GetFaviconForTabIconView() = 0; | 30 virtual gfx::ImageSkia GetFaviconForTabIconView() = 0; |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 static void InitializeIfNeeded(); | 33 static void InitializeIfNeeded(); |
| 32 | 34 |
| 33 explicit TabIconView(TabIconViewModel* provider); | 35 explicit TabIconView(TabIconViewModel* provider); |
| 34 virtual ~TabIconView(); | 36 virtual ~TabIconView(); |
| 35 | 37 |
| 36 // Invoke whenever the tab state changes or the throbber should update. | 38 // Invoke whenever the tab state changes or the throbber should update. |
| 37 void Update(); | 39 void Update(); |
| 38 | 40 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 64 bool is_light_; | 66 bool is_light_; |
| 65 | 67 |
| 66 // Current frame of the throbber being painted. This is only used if | 68 // Current frame of the throbber being painted. This is only used if |
| 67 // throbber_running_ is true. | 69 // throbber_running_ is true. |
| 68 int throbber_frame_; | 70 int throbber_frame_; |
| 69 | 71 |
| 70 DISALLOW_COPY_AND_ASSIGN(TabIconView); | 72 DISALLOW_COPY_AND_ASSIGN(TabIconView); |
| 71 }; | 73 }; |
| 72 | 74 |
| 73 #endif // CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_H_ | 75 #endif // CHROME_BROWSER_UI_VIEWS_TAB_ICON_VIEW_H_ |
| OLD | NEW |