OLD | NEW |
1 // Copyright (c) 2012 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 #include "chrome/browser/ui/views/tab_icon_view.h" | 5 #include "chrome/browser/ui/views/tab_icon_view.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif | 10 #endif |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 DestroyIcon(app_icon); | 50 DestroyIcon(app_icon); |
51 #else | 51 #else |
52 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 52 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
53 g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); | 53 g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); |
54 #endif | 54 #endif |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 TabIconView::TabIconView(TabIconViewModel* model, | 58 TabIconView::TabIconView(TabIconViewModel* model, |
59 views::MenuButtonListener* listener) | 59 views::MenuButtonListener* listener) |
60 : views::MenuButton(NULL, base::string16(), listener, false), | 60 : views::MenuButton(base::string16(), listener, false), |
61 model_(model), | 61 model_(model), |
62 is_light_(false) { | 62 is_light_(false) { |
63 InitializeIfNeeded(); | 63 InitializeIfNeeded(); |
64 } | 64 } |
65 | 65 |
66 TabIconView::~TabIconView() { | 66 TabIconView::~TabIconView() { |
67 } | 67 } |
68 | 68 |
69 void TabIconView::Update() { | 69 void TabIconView::Update() { |
70 if (!model_->ShouldTabIconViewAnimate()) | 70 if (!model_->ShouldTabIconViewAnimate()) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 gfx::ImageSkia favicon = model_->GetFaviconForTabIconView(); | 131 gfx::ImageSkia favicon = model_->GetFaviconForTabIconView(); |
132 if (!favicon.isNull()) { | 132 if (!favicon.isNull()) { |
133 rendered = true; | 133 rendered = true; |
134 PaintFavicon(canvas, favicon); | 134 PaintFavicon(canvas, favicon); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 if (!rendered) | 138 if (!rendered) |
139 PaintFavicon(canvas, *g_default_favicon); | 139 PaintFavicon(canvas, *g_default_favicon); |
140 } | 140 } |
OLD | NEW |