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

Side by Side Diff: chrome/browser/task_manager/task_manager_notification_resource_provider.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_resource_providers.h" 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/debugger/devtools_window.h" 10 #include "chrome/browser/debugger/devtools_window.h"
11 #include "chrome/browser/notifications/balloon.h"
11 #include "chrome/browser/notifications/balloon_collection.h" 12 #include "chrome/browser/notifications/balloon_collection.h"
12 #include "chrome/browser/notifications/balloon_host.h" 13 #include "chrome/browser/notifications/balloon_host.h"
13 #include "chrome/browser/notifications/balloon.h"
14 #include "chrome/browser/notifications/notification_ui_manager.h" 14 #include "chrome/browser/notifications/notification_ui_manager.h"
15 #include "chrome/common/chrome_notification_types.h" 15 #include "chrome/common/chrome_notification_types.h"
16 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
17 #include "content/public/browser/render_process_host.h" 17 #include "content/public/browser/render_process_host.h"
18 #include "content/public/browser/render_view_host.h" 18 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
22 #include "grit/theme_resources_standard.h" 22 #include "grit/theme_resources_standard.h"
23 #include "third_party/skia/include/core/SkBitmap.h"
24 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
25 #include "ui/gfx/image/image_skia.h"
26 26
27 //////////////////////////////////////////////////////////////////////////////// 27 ////////////////////////////////////////////////////////////////////////////////
28 // TaskManagerNotificationResource class 28 // TaskManagerNotificationResource class
29 //////////////////////////////////////////////////////////////////////////////// 29 ////////////////////////////////////////////////////////////////////////////////
30 30
31 SkBitmap* TaskManagerNotificationResource::default_icon_ = NULL; 31 gfx::ImageSkia* TaskManagerNotificationResource::default_icon_ = NULL;
32 32
33 TaskManagerNotificationResource::TaskManagerNotificationResource( 33 TaskManagerNotificationResource::TaskManagerNotificationResource(
34 BalloonHost* balloon_host) 34 BalloonHost* balloon_host)
35 : balloon_host_(balloon_host) { 35 : balloon_host_(balloon_host) {
36 if (!default_icon_) { 36 if (!default_icon_) {
37 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 37 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
38 default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN); 38 default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN);
39 } 39 }
40 process_handle_ = 40 process_handle_ =
41 balloon_host_->web_contents()->GetRenderProcessHost()->GetHandle(); 41 balloon_host_->web_contents()->GetRenderProcessHost()->GetHandle();
42 unique_process_id_ = 42 unique_process_id_ =
43 balloon_host_->web_contents()->GetRenderProcessHost()->GetID(); 43 balloon_host_->web_contents()->GetRenderProcessHost()->GetID();
44 pid_ = base::GetProcId(process_handle_); 44 pid_ = base::GetProcId(process_handle_);
45 title_ = l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NOTIFICATION_PREFIX, 45 title_ = l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NOTIFICATION_PREFIX,
46 balloon_host_->GetSource()); 46 balloon_host_->GetSource());
47 } 47 }
48 48
49 TaskManagerNotificationResource::~TaskManagerNotificationResource() { 49 TaskManagerNotificationResource::~TaskManagerNotificationResource() {
50 } 50 }
51 51
52 string16 TaskManagerNotificationResource::GetTitle() const { 52 string16 TaskManagerNotificationResource::GetTitle() const {
53 return title_; 53 return title_;
54 } 54 }
55 55
56 string16 TaskManagerNotificationResource::GetProfileName() const { 56 string16 TaskManagerNotificationResource::GetProfileName() const {
57 return string16(); 57 return string16();
58 } 58 }
59 59
60 SkBitmap TaskManagerNotificationResource::GetIcon() const { 60 gfx::ImageSkia TaskManagerNotificationResource::GetIcon() const {
61 return *default_icon_; 61 return *default_icon_;
62 } 62 }
63 63
64 base::ProcessHandle TaskManagerNotificationResource::GetProcess() const { 64 base::ProcessHandle TaskManagerNotificationResource::GetProcess() const {
65 return process_handle_; 65 return process_handle_;
66 } 66 }
67 67
68 int TaskManagerNotificationResource::GetUniqueChildProcessId() const { 68 int TaskManagerNotificationResource::GetUniqueChildProcessId() const {
69 return unique_process_id_; 69 return unique_process_id_;
70 } 70 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // Remove the resource from the Task Manager. 187 // Remove the resource from the Task Manager.
188 TaskManagerNotificationResource* resource = iter->second; 188 TaskManagerNotificationResource* resource = iter->second;
189 task_manager_->RemoveResource(resource); 189 task_manager_->RemoveResource(resource);
190 190
191 // Remove it from the map. 191 // Remove it from the map.
192 resources_.erase(iter); 192 resources_.erase(iter);
193 193
194 // Finally, delete the resource. 194 // Finally, delete the resource.
195 delete resource; 195 delete resource;
196 } 196 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager.cc ('k') | chrome/browser/task_manager/task_manager_resource_providers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698