| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEW_TAB_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ |
| 7 | 7 |
| 8 #include "views/view.h" | 8 #include "views/view.h" |
| 9 | 9 |
| 10 class SkBitmap; | 10 class SkBitmap; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 explicit TabIconView(TabIconViewModel* provider); | 32 explicit TabIconView(TabIconViewModel* provider); |
| 33 virtual ~TabIconView(); | 33 virtual ~TabIconView(); |
| 34 | 34 |
| 35 // Invoke whenever the tab state changes or the throbber should update. | 35 // Invoke whenever the tab state changes or the throbber should update. |
| 36 void Update(); | 36 void Update(); |
| 37 | 37 |
| 38 // Set the throbber to the light style (for use on dark backgrounds). | 38 // Set the throbber to the light style (for use on dark backgrounds). |
| 39 void set_is_light(bool is_light) { is_light_ = is_light; } | 39 void set_is_light(bool is_light) { is_light_ = is_light; } |
| 40 | 40 |
| 41 // Overriden from View | 41 // Overriden from View |
| 42 virtual void Paint(ChromeCanvas* canvas); | 42 virtual void Paint(gfx::Canvas* canvas); |
| 43 virtual gfx::Size GetPreferredSize(); | 43 virtual gfx::Size GetPreferredSize(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void PaintThrobber(ChromeCanvas* canvas); | 46 void PaintThrobber(gfx::Canvas* canvas); |
| 47 void PaintFavIcon(ChromeCanvas* canvas, const SkBitmap& bitmap); | 47 void PaintFavIcon(gfx::Canvas* canvas, const SkBitmap& bitmap); |
| 48 void PaintIcon(ChromeCanvas* canvas, | 48 void PaintIcon(gfx::Canvas* canvas, |
| 49 const SkBitmap& bitmap, | 49 const SkBitmap& bitmap, |
| 50 int src_x, | 50 int src_x, |
| 51 int src_y, | 51 int src_y, |
| 52 int src_w, | 52 int src_w, |
| 53 int src_h, | 53 int src_h, |
| 54 bool filter); | 54 bool filter); |
| 55 | 55 |
| 56 // Our model. | 56 // Our model. |
| 57 TabIconViewModel* model_; | 57 TabIconViewModel* model_; |
| 58 | 58 |
| 59 // Whether the throbber is running. | 59 // Whether the throbber is running. |
| 60 bool throbber_running_; | 60 bool throbber_running_; |
| 61 | 61 |
| 62 // Whether we should display our light or dark style. | 62 // Whether we should display our light or dark style. |
| 63 bool is_light_; | 63 bool is_light_; |
| 64 | 64 |
| 65 // Current frame of the throbber being painted. This is only used if | 65 // Current frame of the throbber being painted. This is only used if |
| 66 // throbber_running_ is true. | 66 // throbber_running_ is true. |
| 67 int throbber_frame_; | 67 int throbber_frame_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(TabIconView); | 69 DISALLOW_COPY_AND_ASSIGN(TabIconView); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 #endif // CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ | 72 #endif // CHROME_BROWSER_VIEW_TAB_ICON_VIEW_H_ |
| OLD | NEW |