| 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/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" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // TaskManagerNotificationResource class | 27 // TaskManagerNotificationResource class |
| 28 //////////////////////////////////////////////////////////////////////////////// | 28 //////////////////////////////////////////////////////////////////////////////// |
| 29 | 29 |
| 30 gfx::ImageSkia* TaskManagerNotificationResource::default_icon_ = NULL; | 30 gfx::ImageSkia* TaskManagerNotificationResource::default_icon_ = NULL; |
| 31 | 31 |
| 32 TaskManagerNotificationResource::TaskManagerNotificationResource( | 32 TaskManagerNotificationResource::TaskManagerNotificationResource( |
| 33 BalloonHost* balloon_host) | 33 BalloonHost* balloon_host) |
| 34 : balloon_host_(balloon_host) { | 34 : balloon_host_(balloon_host) { |
| 35 if (!default_icon_) { | 35 if (!default_icon_) { |
| 36 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 36 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 37 default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN); | 37 default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGINS_FAVICON); |
| 38 } | 38 } |
| 39 process_handle_ = | 39 process_handle_ = |
| 40 balloon_host_->web_contents()->GetRenderProcessHost()->GetHandle(); | 40 balloon_host_->web_contents()->GetRenderProcessHost()->GetHandle(); |
| 41 unique_process_id_ = | 41 unique_process_id_ = |
| 42 balloon_host_->web_contents()->GetRenderProcessHost()->GetID(); | 42 balloon_host_->web_contents()->GetRenderProcessHost()->GetID(); |
| 43 pid_ = base::GetProcId(process_handle_); | 43 pid_ = base::GetProcId(process_handle_); |
| 44 title_ = l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NOTIFICATION_PREFIX, | 44 title_ = l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_NOTIFICATION_PREFIX, |
| 45 balloon_host_->GetSource()); | 45 balloon_host_->GetSource()); |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // Remove the resource from the Task Manager. | 188 // Remove the resource from the Task Manager. |
| 189 TaskManagerNotificationResource* resource = iter->second; | 189 TaskManagerNotificationResource* resource = iter->second; |
| 190 task_manager_->RemoveResource(resource); | 190 task_manager_->RemoveResource(resource); |
| 191 | 191 |
| 192 // Remove it from the map. | 192 // Remove it from the map. |
| 193 resources_.erase(iter); | 193 resources_.erase(iter); |
| 194 | 194 |
| 195 // Finally, delete the resource. | 195 // Finally, delete the resource. |
| 196 delete resource; | 196 delete resource; |
| 197 } | 197 } |
| OLD | NEW |