Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: chrome/browser/ui/views/tab_icon_view.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename methods and vars to make image_scale more clear Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698