| 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 #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 "content/public/browser/child_process_data.h" | 16 #include "content/public/browser/child_process_data.h" |
| 17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/common/process_type.h" | 19 #include "content/public/common/process_type.h" |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| 21 | 21 |
| 22 class BackgroundContents; | 22 class BackgroundContents; |
| 23 class BalloonHost; | 23 class BalloonHost; |
| 24 class Extension; | |
| 25 class TabContentsWrapper; | 24 class TabContentsWrapper; |
| 26 | 25 |
| 27 namespace content { | 26 namespace content { |
| 28 class RenderViewHost; | 27 class RenderViewHost; |
| 29 } | 28 } |
| 30 | 29 |
| 30 namespace extensions { |
| 31 class Extension; |
| 32 } |
| 33 |
| 31 // These file contains the resource providers used in the task manager. | 34 // These file contains the resource providers used in the task manager. |
| 32 | 35 |
| 33 // Base class for various types of render process resources that provides common | 36 // Base class for various types of render process resources that provides common |
| 34 // functionality like stats tracking. | 37 // functionality like stats tracking. |
| 35 class TaskManagerRendererResource : public TaskManager::Resource { | 38 class TaskManagerRendererResource : public TaskManager::Resource { |
| 36 public: | 39 public: |
| 37 TaskManagerRendererResource(base::ProcessHandle process, | 40 TaskManagerRendererResource(base::ProcessHandle process, |
| 38 content::RenderViewHost* render_view_host); | 41 content::RenderViewHost* render_view_host); |
| 39 virtual ~TaskManagerRendererResource(); | 42 virtual ~TaskManagerRendererResource(); |
| 40 | 43 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Called when the underlying tab_contents has been committed, and is thus no | 108 // Called when the underlying tab_contents has been committed, and is thus no |
| 106 // longer an Instant preview. | 109 // longer an Instant preview. |
| 107 void InstantCommitted(); | 110 void InstantCommitted(); |
| 108 | 111 |
| 109 // TaskManager::Resource methods: | 112 // TaskManager::Resource methods: |
| 110 virtual Type GetType() const OVERRIDE; | 113 virtual Type GetType() const OVERRIDE; |
| 111 virtual string16 GetTitle() const OVERRIDE; | 114 virtual string16 GetTitle() const OVERRIDE; |
| 112 virtual string16 GetProfileName() const OVERRIDE; | 115 virtual string16 GetProfileName() const OVERRIDE; |
| 113 virtual SkBitmap GetIcon() const OVERRIDE; | 116 virtual SkBitmap GetIcon() const OVERRIDE; |
| 114 virtual TabContentsWrapper* GetTabContents() const OVERRIDE; | 117 virtual TabContentsWrapper* GetTabContents() const OVERRIDE; |
| 115 virtual const Extension* GetExtension() const OVERRIDE; | 118 virtual const extensions::Extension* GetExtension() const OVERRIDE; |
| 116 | 119 |
| 117 private: | 120 private: |
| 118 bool IsPrerendering() const; | 121 bool IsPrerendering() const; |
| 119 | 122 |
| 120 // Returns true if contains content rendered by an extension. | 123 // Returns true if contains content rendered by an extension. |
| 121 bool HostsExtension() const; | 124 bool HostsExtension() const; |
| 122 | 125 |
| 123 static SkBitmap* prerender_icon_; | 126 static SkBitmap* prerender_icon_; |
| 124 TabContentsWrapper* tab_contents_; | 127 TabContentsWrapper* tab_contents_; |
| 125 bool is_instant_preview_; | 128 bool is_instant_preview_; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 virtual string16 GetTitle() const OVERRIDE; | 354 virtual string16 GetTitle() const OVERRIDE; |
| 352 virtual string16 GetProfileName() const OVERRIDE; | 355 virtual string16 GetProfileName() const OVERRIDE; |
| 353 virtual SkBitmap GetIcon() const OVERRIDE; | 356 virtual SkBitmap GetIcon() const OVERRIDE; |
| 354 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 357 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 355 virtual int GetUniqueChildProcessId() const OVERRIDE; | 358 virtual int GetUniqueChildProcessId() const OVERRIDE; |
| 356 virtual Type GetType() const OVERRIDE; | 359 virtual Type GetType() const OVERRIDE; |
| 357 virtual bool CanInspect() const OVERRIDE; | 360 virtual bool CanInspect() const OVERRIDE; |
| 358 virtual void Inspect() const OVERRIDE; | 361 virtual void Inspect() const OVERRIDE; |
| 359 virtual bool SupportNetworkUsage() const OVERRIDE; | 362 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 360 virtual void SetSupportNetworkUsage() OVERRIDE; | 363 virtual void SetSupportNetworkUsage() OVERRIDE; |
| 361 virtual const Extension* GetExtension() const OVERRIDE; | 364 virtual const extensions::Extension* GetExtension() const OVERRIDE; |
| 362 | 365 |
| 363 // Returns the pid of the extension process. | 366 // Returns the pid of the extension process. |
| 364 int process_id() const { return pid_; } | 367 int process_id() const { return pid_; } |
| 365 | 368 |
| 366 // Returns true if the associated extension has a background page. | 369 // Returns true if the associated extension has a background page. |
| 367 virtual bool IsBackground() const OVERRIDE; | 370 virtual bool IsBackground() const OVERRIDE; |
| 368 | 371 |
| 369 private: | 372 private: |
| 370 // The icon painted for the extension process. | 373 // The icon painted for the extension process. |
| 371 static SkBitmap* default_icon_; | 374 static SkBitmap* default_icon_; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 private: | 551 private: |
| 549 virtual ~TaskManagerBrowserProcessResourceProvider(); | 552 virtual ~TaskManagerBrowserProcessResourceProvider(); |
| 550 | 553 |
| 551 TaskManager* task_manager_; | 554 TaskManager* task_manager_; |
| 552 TaskManagerBrowserProcessResource resource_; | 555 TaskManagerBrowserProcessResource resource_; |
| 553 | 556 |
| 554 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 557 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
| 555 }; | 558 }; |
| 556 | 559 |
| 557 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 560 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| OLD | NEW |