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 21 matching lines...) Expand all Loading... |
32 void TabIconView::InitializeIfNeeded() { | 32 void TabIconView::InitializeIfNeeded() { |
33 if (!g_initialized) { | 33 if (!g_initialized) { |
34 g_initialized = true; | 34 g_initialized = true; |
35 | 35 |
36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
37 // The default window icon is the application icon, not the default | 37 // The default window icon is the application icon, not the default |
38 // favicon. | 38 // favicon. |
39 HICON app_icon = GetAppIcon(); | 39 HICON app_icon = GetAppIcon(); |
40 scoped_ptr<SkBitmap> bitmap( | 40 scoped_ptr<SkBitmap> bitmap( |
41 IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16))); | 41 IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16))); |
42 g_default_favicon = new gfx::ImageSkia( | 42 g_default_favicon = new gfx::ImageSkia(gfx::ImageSkiaRep(*bitmap, 1.0f)); |
43 gfx::ImageSkiaRep(*bitmap, ui::SCALE_FACTOR_100P)); | |
44 DestroyIcon(app_icon); | 43 DestroyIcon(app_icon); |
45 #else | 44 #else |
46 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 45 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
47 g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); | 46 g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); |
48 #endif | 47 #endif |
49 } | 48 } |
50 } | 49 } |
51 | 50 |
52 TabIconView::TabIconView(chrome::TabIconViewModel* model) | 51 TabIconView::TabIconView(chrome::TabIconViewModel* model) |
53 : model_(model), | 52 : model_(model), |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 149 } |
151 } | 150 } |
152 | 151 |
153 if (!rendered) | 152 if (!rendered) |
154 PaintFavicon(canvas, *g_default_favicon); | 153 PaintFavicon(canvas, *g_default_favicon); |
155 } | 154 } |
156 | 155 |
157 gfx::Size TabIconView::GetPreferredSize() { | 156 gfx::Size TabIconView::GetPreferredSize() { |
158 return gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize); | 157 return gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize); |
159 } | 158 } |
OLD | NEW |