OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(TaskManagerRendererResource); | 75 DISALLOW_COPY_AND_ASSIGN(TaskManagerRendererResource); |
76 }; | 76 }; |
77 | 77 |
78 class TaskManagerTabContentsResource : public TaskManagerRendererResource { | 78 class TaskManagerTabContentsResource : public TaskManagerRendererResource { |
79 public: | 79 public: |
80 explicit TaskManagerTabContentsResource(TabContents* tab_contents); | 80 explicit TaskManagerTabContentsResource(TabContents* tab_contents); |
81 ~TaskManagerTabContentsResource(); | 81 ~TaskManagerTabContentsResource(); |
82 | 82 |
83 // TaskManager::Resource methods: | 83 // TaskManager::Resource methods: |
84 std::wstring GetTitle() const; | 84 virtual std::wstring GetTitle() const; |
85 SkBitmap GetIcon() const; | 85 virtual SkBitmap GetIcon() const; |
86 TabContents* GetTabContents() const; | 86 virtual TabContents* GetTabContents() const; |
87 | 87 |
88 private: | 88 private: |
89 TabContents* tab_contents_; | 89 TabContents* tab_contents_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource); | 91 DISALLOW_COPY_AND_ASSIGN(TaskManagerTabContentsResource); |
92 }; | 92 }; |
93 | 93 |
94 class TaskManagerTabContentsResourceProvider | 94 class TaskManagerTabContentsResourceProvider |
95 : public TaskManager::ResourceProvider, | 95 : public TaskManager::ResourceProvider, |
96 public NotificationObserver { | 96 public NotificationObserver { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 class TaskManagerBackgroundContentsResource | 135 class TaskManagerBackgroundContentsResource |
136 : public TaskManagerRendererResource { | 136 : public TaskManagerRendererResource { |
137 public: | 137 public: |
138 TaskManagerBackgroundContentsResource( | 138 TaskManagerBackgroundContentsResource( |
139 BackgroundContents* background_contents, | 139 BackgroundContents* background_contents, |
140 const std::wstring& application_name); | 140 const std::wstring& application_name); |
141 ~TaskManagerBackgroundContentsResource(); | 141 ~TaskManagerBackgroundContentsResource(); |
142 | 142 |
143 // TaskManager::Resource methods: | 143 // TaskManager::Resource methods: |
144 std::wstring GetTitle() const; | 144 virtual std::wstring GetTitle() const; |
| 145 virtual SkBitmap GetIcon() const; |
| 146 virtual bool IsBackground() const; |
| 147 |
145 const std::wstring& application_name() const { return application_name_; } | 148 const std::wstring& application_name() const { return application_name_; } |
146 SkBitmap GetIcon() const; | |
147 | |
148 private: | 149 private: |
149 BackgroundContents* background_contents_; | 150 BackgroundContents* background_contents_; |
150 | 151 |
151 std::wstring application_name_; | 152 std::wstring application_name_; |
152 | 153 |
153 // The icon painted for BackgroundContents. | 154 // The icon painted for BackgroundContents. |
154 // TODO(atwilson): Use the favicon when there's a way to get the favicon for | 155 // TODO(atwilson): Use the favicon when there's a way to get the favicon for |
155 // BackgroundContents. | 156 // BackgroundContents. |
156 static SkBitmap* default_icon_; | 157 static SkBitmap* default_icon_; |
157 | 158 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 SkBitmap GetIcon() const; | 303 SkBitmap GetIcon() const; |
303 base::ProcessHandle GetProcess() const; | 304 base::ProcessHandle GetProcess() const; |
304 Type GetType() const { return EXTENSION; } | 305 Type GetType() const { return EXTENSION; } |
305 bool SupportNetworkUsage() const { return true; } | 306 bool SupportNetworkUsage() const { return true; } |
306 void SetSupportNetworkUsage() { NOTREACHED(); } | 307 void SetSupportNetworkUsage() { NOTREACHED(); } |
307 const Extension* GetExtension() const; | 308 const Extension* GetExtension() const; |
308 | 309 |
309 // Returns the pid of the extension process. | 310 // Returns the pid of the extension process. |
310 int process_id() const { return pid_; } | 311 int process_id() const { return pid_; } |
311 | 312 |
| 313 // Returns true if the associated extension has a background page. |
| 314 bool IsBackground() const; |
312 private: | 315 private: |
313 // The icon painted for the extension process. | 316 // The icon painted for the extension process. |
314 static SkBitmap* default_icon_; | 317 static SkBitmap* default_icon_; |
315 | 318 |
316 ExtensionHost* extension_host_; | 319 ExtensionHost* extension_host_; |
317 | 320 |
318 // Cached data about the extension. | 321 // Cached data about the extension. |
319 base::ProcessHandle process_handle_; | 322 base::ProcessHandle process_handle_; |
320 int pid_; | 323 int pid_; |
321 std::wstring title_; | 324 std::wstring title_; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 483 |
481 void AddToTaskManager(ChildProcessInfo child_process_info); | 484 void AddToTaskManager(ChildProcessInfo child_process_info); |
482 | 485 |
483 TaskManager* task_manager_; | 486 TaskManager* task_manager_; |
484 TaskManagerBrowserProcessResource resource_; | 487 TaskManagerBrowserProcessResource resource_; |
485 | 488 |
486 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 489 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
487 }; | 490 }; |
488 | 491 |
489 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 492 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
OLD | NEW |