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

Side by Side Diff: chrome/browser/task_manager/task_manager.cc

Issue 10453101: Convert most of the rest of chrome to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/i18n/number_formatting.h" 9 #include "base/i18n/number_formatting.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 21 matching lines...) Expand all
32 #include "content/public/browser/browser_child_process_host.h" 32 #include "content/public/browser/browser_child_process_host.h"
33 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
34 #include "content/public/browser/render_view_host.h" 34 #include "content/public/browser/render_view_host.h"
35 #include "content/public/browser/resource_request_info.h" 35 #include "content/public/browser/resource_request_info.h"
36 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
37 #include "content/public/browser/web_contents_delegate.h" 37 #include "content/public/browser/web_contents_delegate.h"
38 #include "content/public/common/result_codes.h" 38 #include "content/public/common/result_codes.h"
39 #include "grit/chromium_strings.h" 39 #include "grit/chromium_strings.h"
40 #include "grit/generated_resources.h" 40 #include "grit/generated_resources.h"
41 #include "grit/ui_resources.h" 41 #include "grit/ui_resources.h"
42 #include "third_party/skia/include/core/SkBitmap.h"
43 #include "ui/base/l10n/l10n_util.h" 42 #include "ui/base/l10n/l10n_util.h"
44 #include "ui/base/resource/resource_bundle.h" 43 #include "ui/base/resource/resource_bundle.h"
45 #include "ui/base/text/bytes_formatting.h" 44 #include "ui/base/text/bytes_formatting.h"
45 #include "ui/gfx/image/image_skia.h"
46 #include "unicode/coll.h" 46 #include "unicode/coll.h"
47 47
48 using content::BrowserThread; 48 using content::BrowserThread;
49 using content::OpenURLParams; 49 using content::OpenURLParams;
50 using content::Referrer; 50 using content::Referrer;
51 using content::ResourceRequestInfo; 51 using content::ResourceRequestInfo;
52 using content::WebContents; 52 using content::WebContents;
53 53
54 namespace { 54 namespace {
55 55
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 DCHECK(iter != group_map_.end()); 299 DCHECK(iter != group_map_.end());
300 const ResourceList* group = iter->second; 300 const ResourceList* group = iter->second;
301 return (group->back() == resource); 301 return (group->back() == resource);
302 } 302 }
303 303
304 bool TaskManagerModel::IsBackgroundResource(int index) const { 304 bool TaskManagerModel::IsBackgroundResource(int index) const {
305 CHECK_LT(index, ResourceCount()); 305 CHECK_LT(index, ResourceCount());
306 return resources_[index]->IsBackground(); 306 return resources_[index]->IsBackground();
307 } 307 }
308 308
309 SkBitmap TaskManagerModel::GetResourceIcon(int index) const { 309 gfx::ImageSkia TaskManagerModel::GetResourceIcon(int index) const {
310 CHECK_LT(index, ResourceCount()); 310 CHECK_LT(index, ResourceCount());
311 SkBitmap icon = resources_[index]->GetIcon(); 311 gfx::ImageSkia icon = resources_[index]->GetIcon();
312 if (!icon.isNull()) 312 if (!icon.isNull())
313 return icon; 313 return icon;
314 314
315 static SkBitmap* default_icon = ResourceBundle::GetSharedInstance(). 315 static gfx::ImageSkia* default_icon = ResourceBundle::GetSharedInstance().
316 GetBitmapNamed(IDR_DEFAULT_FAVICON); 316 GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
317 return *default_icon; 317 return *default_icon;
318 } 318 }
319 319
320 TaskManagerModel::GroupRange 320 TaskManagerModel::GroupRange
321 TaskManagerModel::GetGroupRangeForResource(int index) const { 321 TaskManagerModel::GetGroupRangeForResource(int index) const {
322 CHECK_LT(index, ResourceCount()); 322 CHECK_LT(index, ResourceCount());
323 TaskManager::Resource* resource = resources_[index]; 323 TaskManager::Resource* resource = resources_[index];
324 GroupMap::const_iterator group_iter = 324 GroupMap::const_iterator group_iter =
325 group_map_.find(resource->GetProcess()); 325 group_map_.find(resource->GetProcess());
326 DCHECK(group_iter != group_map_.end()); 326 DCHECK(group_iter != group_map_.end());
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 // Count the number of extensions with background pages (including 1192 // Count the number of extensions with background pages (including
1193 // incognito). 1193 // incognito).
1194 count += CountExtensionBackgroundPagesForProfile(profile); 1194 count += CountExtensionBackgroundPagesForProfile(profile);
1195 if (profile->HasOffTheRecordProfile()) { 1195 if (profile->HasOffTheRecordProfile()) {
1196 count += CountExtensionBackgroundPagesForProfile( 1196 count += CountExtensionBackgroundPagesForProfile(
1197 profile->GetOffTheRecordProfile()); 1197 profile->GetOffTheRecordProfile());
1198 } 1198 }
1199 } 1199 }
1200 return count; 1200 return count;
1201 } 1201 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager.h ('k') | chrome/browser/task_manager/task_manager_notification_resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698