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

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

Issue 10736063: views: Extract TabIconViewModel into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/tab_icon_view.h ('k') | chrome/browser/ui/views/tab_icon_view_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 11
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "chrome/app/chrome_command_ids.h" 15 #include "chrome/app/chrome_command_ids.h"
16 #include "chrome/browser/ui/views/tab_icon_view_model.h"
16 #include "grit/theme_resources.h" 17 #include "grit/theme_resources.h"
17 #include "grit/ui_resources.h" 18 #include "grit/ui_resources.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/base/theme_provider.h" 20 #include "ui/base/theme_provider.h"
20 #include "ui/gfx/canvas.h" 21 #include "ui/gfx/canvas.h"
21 #include "ui/gfx/favicon_size.h" 22 #include "ui/gfx/favicon_size.h"
22 23
23 #if defined(OS_WIN) 24 #if defined(OS_WIN)
24 #include "chrome/browser/app_icon_win.h" 25 #include "chrome/browser/app_icon_win.h"
25 #include "ui/gfx/icon_util.h" 26 #include "ui/gfx/icon_util.h"
(...skipping 15 matching lines...) Expand all
41 IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16))); 42 IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16)));
42 g_default_favicon = new gfx::ImageSkia(*bitmap); 43 g_default_favicon = new gfx::ImageSkia(*bitmap);
43 DestroyIcon(app_icon); 44 DestroyIcon(app_icon);
44 #else 45 #else
45 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 46 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
46 g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16); 47 g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16);
47 #endif 48 #endif
48 } 49 }
49 } 50 }
50 51
51 TabIconView::TabIconView(TabIconViewModel* model) 52 TabIconView::TabIconView(chrome::TabIconViewModel* model)
52 : model_(model), 53 : model_(model),
53 throbber_running_(false), 54 throbber_running_(false),
54 is_light_(false), 55 is_light_(false),
55 throbber_frame_(0) { 56 throbber_frame_(0) {
56 InitializeIfNeeded(); 57 InitializeIfNeeded();
57 } 58 }
58 59
59 TabIconView::~TabIconView() { 60 TabIconView::~TabIconView() {
60 } 61 }
61 62
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 149 }
149 } 150 }
150 151
151 if (!rendered) 152 if (!rendered)
152 PaintFavicon(canvas, *g_default_favicon); 153 PaintFavicon(canvas, *g_default_favicon);
153 } 154 }
154 155
155 gfx::Size TabIconView::GetPreferredSize() { 156 gfx::Size TabIconView::GetPreferredSize() {
156 return gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize); 157 return gfx::Size(gfx::kFaviconSize, gfx::kFaviconSize);
157 } 158 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_icon_view.h ('k') | chrome/browser/ui/views/tab_icon_view_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698