| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/notifications/balloon_collection.h" | 11 #include "chrome/browser/notifications/balloon_collection.h" |
| 11 #include "chrome/browser/notifications/balloon_host.h" | 12 #include "chrome/browser/notifications/balloon_host.h" |
| 12 #include "chrome/browser/notifications/notification_ui_manager.h" | 13 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "content/browser/renderer_host/render_process_host.h" | 15 #include "content/browser/renderer_host/render_process_host.h" |
| 15 #include "content/browser/renderer_host/render_view_host.h" | 16 #include "content/browser/renderer_host/render_view_host.h" |
| 16 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 18 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
| 19 #include "grit/theme_resources_standard.h" | 20 #include "grit/theme_resources_standard.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 57 } |
| 57 | 58 |
| 58 base::ProcessHandle TaskManagerNotificationResource::GetProcess() const { | 59 base::ProcessHandle TaskManagerNotificationResource::GetProcess() const { |
| 59 return process_handle_; | 60 return process_handle_; |
| 60 } | 61 } |
| 61 | 62 |
| 62 TaskManager::Resource::Type TaskManagerNotificationResource::GetType() const { | 63 TaskManager::Resource::Type TaskManagerNotificationResource::GetType() const { |
| 63 return NOTIFICATION; | 64 return NOTIFICATION; |
| 64 } | 65 } |
| 65 | 66 |
| 67 bool TaskManagerNotificationResource::CanInspect() const { |
| 68 return true; |
| 69 } |
| 70 |
| 71 void TaskManagerNotificationResource::Inspect() const { |
| 72 DevToolsWindow::OpenDevToolsWindow(balloon_host_->render_view_host()); |
| 73 } |
| 74 |
| 66 bool TaskManagerNotificationResource::SupportNetworkUsage() const { | 75 bool TaskManagerNotificationResource::SupportNetworkUsage() const { |
| 67 return false; | 76 return false; |
| 68 } | 77 } |
| 69 | 78 |
| 70 //////////////////////////////////////////////////////////////////////////////// | 79 //////////////////////////////////////////////////////////////////////////////// |
| 71 // TaskManagerNotificationResourceProvider class | 80 // TaskManagerNotificationResourceProvider class |
| 72 //////////////////////////////////////////////////////////////////////////////// | 81 //////////////////////////////////////////////////////////////////////////////// |
| 73 | 82 |
| 74 // static | 83 // static |
| 75 TaskManagerNotificationResourceProvider* | 84 TaskManagerNotificationResourceProvider* |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // Remove the resource from the Task Manager. | 177 // Remove the resource from the Task Manager. |
| 169 TaskManagerNotificationResource* resource = iter->second; | 178 TaskManagerNotificationResource* resource = iter->second; |
| 170 task_manager_->RemoveResource(resource); | 179 task_manager_->RemoveResource(resource); |
| 171 | 180 |
| 172 // Remove it from the map. | 181 // Remove it from the map. |
| 173 resources_.erase(iter); | 182 resources_.erase(iter); |
| 174 | 183 |
| 175 // Finally, delete the resource. | 184 // Finally, delete the resource. |
| 176 delete resource; | 185 delete resource; |
| 177 } | 186 } |
| OLD | NEW |