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