| Index: chrome/browser/task_manager/task_manager_resource_providers.h
|
| diff --git a/chrome/browser/task_manager/task_manager_resource_providers.h b/chrome/browser/task_manager/task_manager_resource_providers.h
|
| index a926ac25f0fca682f912758cbe3f14d3705875cb..47c5f2ff306f5af6f8bc10218c506f5612f29d79 100644
|
| --- a/chrome/browser/task_manager/task_manager_resource_providers.h
|
| +++ b/chrome/browser/task_manager/task_manager_resource_providers.h
|
| @@ -21,6 +21,7 @@
|
| class BackgroundContents;
|
| class BalloonHost;
|
| class TabContents;
|
| +class Panel;
|
|
|
| namespace content {
|
| class RenderViewHost;
|
| @@ -113,7 +114,7 @@ class TaskManagerTabContentsResource : public TaskManagerRendererResource {
|
| virtual string16 GetTitle() const OVERRIDE;
|
| virtual string16 GetProfileName() const OVERRIDE;
|
| virtual gfx::ImageSkia GetIcon() const OVERRIDE;
|
| - virtual TabContents* GetTabContents() const OVERRIDE;
|
| + virtual content::WebContents* GetWebContents() const OVERRIDE;
|
| virtual const extensions::Extension* GetExtension() const OVERRIDE;
|
|
|
| private:
|
| @@ -171,6 +172,68 @@ class TaskManagerTabContentsResourceProvider
|
| DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResourceProvider);
|
| };
|
|
|
| +class TaskManagerPanelResource : public TaskManagerRendererResource {
|
| + public:
|
| + explicit TaskManagerPanelResource(Panel* panel);
|
| + virtual ~TaskManagerPanelResource();
|
| +
|
| + // TaskManager::Resource methods:
|
| + virtual Type GetType() const OVERRIDE;
|
| + virtual string16 GetTitle() const OVERRIDE;
|
| + virtual string16 GetProfileName() const OVERRIDE;
|
| + virtual gfx::ImageSkia GetIcon() const OVERRIDE;
|
| + virtual content::WebContents* GetWebContents() const OVERRIDE;
|
| + virtual const extensions::Extension* GetExtension() const OVERRIDE;
|
| +
|
| + private:
|
| + Panel* panel_;
|
| + // Determines prefix for title reflecting whether extensions are apps
|
| + // or in incognito mode.
|
| + int message_prefix_id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TaskManagerPanelResource);
|
| +};
|
| +
|
| +class TaskManagerPanelResourceProvider
|
| + : public TaskManager::ResourceProvider,
|
| + public content::NotificationObserver {
|
| + public:
|
| + explicit TaskManagerPanelResourceProvider(TaskManager* task_manager);
|
| +
|
| + // TaskManager::ResourceProvider methods:
|
| + virtual TaskManager::Resource* GetResource(int origin_pid,
|
| + int render_process_host_id,
|
| + int routing_id) OVERRIDE;
|
| + virtual void StartUpdating() OVERRIDE;
|
| + virtual void StopUpdating() OVERRIDE;
|
| +
|
| + // content::NotificationObserver method:
|
| + virtual void Observe(int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) OVERRIDE;
|
| +
|
| + private:
|
| + virtual ~TaskManagerPanelResourceProvider();
|
| +
|
| + void Add(Panel* panel);
|
| + void Remove(Panel* panel);
|
| +
|
| + // Whether we are currently reporting to the task manager. Used to ignore
|
| + // notifications sent after StopUpdating().
|
| + bool updating_;
|
| +
|
| + TaskManager* task_manager_;
|
| +
|
| + // Maps the actual resources (the Panels) to the Task Manager resources.
|
| + typedef std::map<Panel*, TaskManagerPanelResource*> PanelResourceMap;
|
| + PanelResourceMap resources_;
|
| +
|
| + // A scoped container for notification registries.
|
| + content::NotificationRegistrar registrar_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TaskManagerPanelResourceProvider);
|
| +};
|
| +
|
| class TaskManagerBackgroundContentsResource
|
| : public TaskManagerRendererResource {
|
| public:
|
|
|