| 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 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
| 15 #include "chrome/browser/task_manager/task_manager.h" | 15 #include "chrome/browser/task_manager/task_manager.h" |
| 16 #include "chrome/common/child_process_info.h" | |
| 17 #include "chrome/common/notification_observer.h" | 16 #include "chrome/common/notification_observer.h" |
| 18 #include "chrome/common/notification_registrar.h" | 17 #include "chrome/common/notification_registrar.h" |
| 18 #include "content/common/child_process_info.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 20 | 20 |
| 21 class BackgroundContents; | 21 class BackgroundContents; |
| 22 class BalloonHost; | 22 class BalloonHost; |
| 23 class Extension; | 23 class Extension; |
| 24 class ExtensionHost; | 24 class ExtensionHost; |
| 25 class RenderViewHost; | 25 class RenderViewHost; |
| 26 class TabContents; | 26 class TabContents; |
| 27 | 27 |
| 28 // These file contains the resource providers used in the task manager. | 28 // These file contains the resource providers used in the task manager. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 virtual SkBitmap GetIcon() const OVERRIDE; | 217 virtual SkBitmap GetIcon() const OVERRIDE; |
| 218 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 218 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 219 virtual Type GetType() const OVERRIDE; | 219 virtual Type GetType() const OVERRIDE; |
| 220 virtual bool SupportNetworkUsage() const OVERRIDE; | 220 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 221 virtual void SetSupportNetworkUsage() OVERRIDE; | 221 virtual void SetSupportNetworkUsage() OVERRIDE; |
| 222 | 222 |
| 223 // Returns the pid of the child process. | 223 // Returns the pid of the child process. |
| 224 int process_id() const { return pid_; } | 224 int process_id() const { return pid_; } |
| 225 | 225 |
| 226 private: | 226 private: |
| 227 // Returns a localized title for the child process. For example, a plugin |
| 228 // process would be "Plug-in: Flash" when name is "Flash". |
| 229 string16 GetLocalizedTitle() const; |
| 230 |
| 227 ChildProcessInfo child_process_; | 231 ChildProcessInfo child_process_; |
| 228 int pid_; | 232 int pid_; |
| 229 mutable string16 title_; | 233 mutable string16 title_; |
| 230 bool network_usage_support_; | 234 bool network_usage_support_; |
| 231 | 235 |
| 232 // The icon painted for the child processs. | 236 // The icon painted for the child processs. |
| 233 // TODO(jcampan): we should have plugin specific icons for well-known | 237 // TODO(jcampan): we should have plugin specific icons for well-known |
| 234 // plugins. | 238 // plugins. |
| 235 static SkBitmap* default_icon_; | 239 static SkBitmap* default_icon_; |
| 236 | 240 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 | 482 |
| 479 void AddToTaskManager(ChildProcessInfo child_process_info); | 483 void AddToTaskManager(ChildProcessInfo child_process_info); |
| 480 | 484 |
| 481 TaskManager* task_manager_; | 485 TaskManager* task_manager_; |
| 482 TaskManagerBrowserProcessResource resource_; | 486 TaskManagerBrowserProcessResource resource_; |
| 483 | 487 |
| 484 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 488 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
| 485 }; | 489 }; |
| 486 | 490 |
| 487 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 491 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| OLD | NEW |