| 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> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class TaskManagerTabContentsResource : public TaskManagerRendererResource { | 91 class TaskManagerTabContentsResource : public TaskManagerRendererResource { |
| 92 public: | 92 public: |
| 93 explicit TaskManagerTabContentsResource(TabContentsWrapper* tab_contents); | 93 explicit TaskManagerTabContentsResource(TabContentsWrapper* tab_contents); |
| 94 virtual ~TaskManagerTabContentsResource(); | 94 virtual ~TaskManagerTabContentsResource(); |
| 95 | 95 |
| 96 // TaskManager::Resource methods: | 96 // TaskManager::Resource methods: |
| 97 virtual Type GetType() const OVERRIDE; | 97 virtual Type GetType() const OVERRIDE; |
| 98 virtual string16 GetTitle() const OVERRIDE; | 98 virtual string16 GetTitle() const OVERRIDE; |
| 99 virtual string16 GetProfileName() const OVERRIDE; |
| 99 virtual SkBitmap GetIcon() const OVERRIDE; | 100 virtual SkBitmap GetIcon() const OVERRIDE; |
| 100 virtual TabContentsWrapper* GetTabContents() const OVERRIDE; | 101 virtual TabContentsWrapper* GetTabContents() const OVERRIDE; |
| 101 virtual const Extension* GetExtension() const OVERRIDE; | 102 virtual const Extension* GetExtension() const OVERRIDE; |
| 102 | 103 |
| 103 private: | 104 private: |
| 104 bool IsPrerendering() const; | 105 bool IsPrerendering() const; |
| 105 | 106 |
| 106 // Returns true if contains content rendered by an extension. | 107 // Returns true if contains content rendered by an extension. |
| 107 bool HostsExtension() const; | 108 bool HostsExtension() const; |
| 108 | 109 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 class TaskManagerBackgroundContentsResource | 157 class TaskManagerBackgroundContentsResource |
| 157 : public TaskManagerRendererResource { | 158 : public TaskManagerRendererResource { |
| 158 public: | 159 public: |
| 159 TaskManagerBackgroundContentsResource( | 160 TaskManagerBackgroundContentsResource( |
| 160 BackgroundContents* background_contents, | 161 BackgroundContents* background_contents, |
| 161 const string16& application_name); | 162 const string16& application_name); |
| 162 virtual ~TaskManagerBackgroundContentsResource(); | 163 virtual ~TaskManagerBackgroundContentsResource(); |
| 163 | 164 |
| 164 // TaskManager::Resource methods: | 165 // TaskManager::Resource methods: |
| 165 virtual string16 GetTitle() const OVERRIDE; | 166 virtual string16 GetTitle() const OVERRIDE; |
| 167 virtual string16 GetProfileName() const OVERRIDE; |
| 166 virtual SkBitmap GetIcon() const OVERRIDE; | 168 virtual SkBitmap GetIcon() const OVERRIDE; |
| 167 virtual bool IsBackground() const OVERRIDE; | 169 virtual bool IsBackground() const OVERRIDE; |
| 168 | 170 |
| 169 const string16& application_name() const { return application_name_; } | 171 const string16& application_name() const { return application_name_; } |
| 170 private: | 172 private: |
| 171 BackgroundContents* background_contents_; | 173 BackgroundContents* background_contents_; |
| 172 | 174 |
| 173 string16 application_name_; | 175 string16 application_name_; |
| 174 | 176 |
| 175 // The icon painted for BackgroundContents. | 177 // The icon painted for BackgroundContents. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 DISALLOW_COPY_AND_ASSIGN(TaskManagerBackgroundContentsResourceProvider); | 226 DISALLOW_COPY_AND_ASSIGN(TaskManagerBackgroundContentsResourceProvider); |
| 225 }; | 227 }; |
| 226 | 228 |
| 227 class TaskManagerChildProcessResource : public TaskManager::Resource { | 229 class TaskManagerChildProcessResource : public TaskManager::Resource { |
| 228 public: | 230 public: |
| 229 explicit TaskManagerChildProcessResource(const ChildProcessInfo& child_proc); | 231 explicit TaskManagerChildProcessResource(const ChildProcessInfo& child_proc); |
| 230 virtual ~TaskManagerChildProcessResource(); | 232 virtual ~TaskManagerChildProcessResource(); |
| 231 | 233 |
| 232 // TaskManager::Resource methods: | 234 // TaskManager::Resource methods: |
| 233 virtual string16 GetTitle() const OVERRIDE; | 235 virtual string16 GetTitle() const OVERRIDE; |
| 236 virtual string16 GetProfileName() const OVERRIDE; |
| 234 virtual SkBitmap GetIcon() const OVERRIDE; | 237 virtual SkBitmap GetIcon() const OVERRIDE; |
| 235 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 238 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 236 virtual Type GetType() const OVERRIDE; | 239 virtual Type GetType() const OVERRIDE; |
| 237 virtual bool SupportNetworkUsage() const OVERRIDE; | 240 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 238 virtual void SetSupportNetworkUsage() OVERRIDE; | 241 virtual void SetSupportNetworkUsage() OVERRIDE; |
| 239 | 242 |
| 240 // Returns the pid of the child process. | 243 // Returns the pid of the child process. |
| 241 int process_id() const { return pid_; } | 244 int process_id() const { return pid_; } |
| 242 | 245 |
| 243 private: | 246 private: |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 DISALLOW_COPY_AND_ASSIGN(TaskManagerChildProcessResourceProvider); | 315 DISALLOW_COPY_AND_ASSIGN(TaskManagerChildProcessResourceProvider); |
| 313 }; | 316 }; |
| 314 | 317 |
| 315 class TaskManagerExtensionProcessResource : public TaskManager::Resource { | 318 class TaskManagerExtensionProcessResource : public TaskManager::Resource { |
| 316 public: | 319 public: |
| 317 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); | 320 explicit TaskManagerExtensionProcessResource(ExtensionHost* extension_host); |
| 318 virtual ~TaskManagerExtensionProcessResource(); | 321 virtual ~TaskManagerExtensionProcessResource(); |
| 319 | 322 |
| 320 // TaskManager::Resource methods: | 323 // TaskManager::Resource methods: |
| 321 virtual string16 GetTitle() const OVERRIDE; | 324 virtual string16 GetTitle() const OVERRIDE; |
| 325 virtual string16 GetProfileName() const OVERRIDE; |
| 322 virtual SkBitmap GetIcon() const OVERRIDE; | 326 virtual SkBitmap GetIcon() const OVERRIDE; |
| 323 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 327 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 324 virtual Type GetType() const OVERRIDE; | 328 virtual Type GetType() const OVERRIDE; |
| 325 virtual bool SupportNetworkUsage() const OVERRIDE; | 329 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 326 virtual void SetSupportNetworkUsage() OVERRIDE; | 330 virtual void SetSupportNetworkUsage() OVERRIDE; |
| 327 virtual const Extension* GetExtension() const OVERRIDE; | 331 virtual const Extension* GetExtension() const OVERRIDE; |
| 328 | 332 |
| 329 // Returns the pid of the extension process. | 333 // Returns the pid of the extension process. |
| 330 int process_id() const { return pid_; } | 334 int process_id() const { return pid_; } |
| 331 | 335 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 DISALLOW_COPY_AND_ASSIGN(TaskManagerExtensionProcessResourceProvider); | 391 DISALLOW_COPY_AND_ASSIGN(TaskManagerExtensionProcessResourceProvider); |
| 388 }; | 392 }; |
| 389 | 393 |
| 390 class TaskManagerNotificationResource : public TaskManager::Resource { | 394 class TaskManagerNotificationResource : public TaskManager::Resource { |
| 391 public: | 395 public: |
| 392 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); | 396 explicit TaskManagerNotificationResource(BalloonHost* balloon_host); |
| 393 virtual ~TaskManagerNotificationResource(); | 397 virtual ~TaskManagerNotificationResource(); |
| 394 | 398 |
| 395 // TaskManager::Resource interface | 399 // TaskManager::Resource interface |
| 396 virtual string16 GetTitle() const OVERRIDE; | 400 virtual string16 GetTitle() const OVERRIDE; |
| 401 virtual string16 GetProfileName() const OVERRIDE; |
| 397 virtual SkBitmap GetIcon() const OVERRIDE; | 402 virtual SkBitmap GetIcon() const OVERRIDE; |
| 398 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 403 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 399 virtual Type GetType() const OVERRIDE; | 404 virtual Type GetType() const OVERRIDE; |
| 400 virtual bool SupportNetworkUsage() const OVERRIDE; | 405 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 401 virtual void SetSupportNetworkUsage() OVERRIDE { } | 406 virtual void SetSupportNetworkUsage() OVERRIDE { } |
| 402 | 407 |
| 403 private: | 408 private: |
| 404 // The icon painted for notifications. . | 409 // The icon painted for notifications. . |
| 405 static SkBitmap* default_icon_; | 410 static SkBitmap* default_icon_; |
| 406 | 411 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 DISALLOW_COPY_AND_ASSIGN(TaskManagerNotificationResourceProvider); | 459 DISALLOW_COPY_AND_ASSIGN(TaskManagerNotificationResourceProvider); |
| 455 }; | 460 }; |
| 456 | 461 |
| 457 class TaskManagerBrowserProcessResource : public TaskManager::Resource { | 462 class TaskManagerBrowserProcessResource : public TaskManager::Resource { |
| 458 public: | 463 public: |
| 459 TaskManagerBrowserProcessResource(); | 464 TaskManagerBrowserProcessResource(); |
| 460 virtual ~TaskManagerBrowserProcessResource(); | 465 virtual ~TaskManagerBrowserProcessResource(); |
| 461 | 466 |
| 462 // TaskManager::Resource methods: | 467 // TaskManager::Resource methods: |
| 463 virtual string16 GetTitle() const OVERRIDE; | 468 virtual string16 GetTitle() const OVERRIDE; |
| 469 virtual string16 GetProfileName() const OVERRIDE; |
| 464 virtual SkBitmap GetIcon() const OVERRIDE; | 470 virtual SkBitmap GetIcon() const OVERRIDE; |
| 465 virtual base::ProcessHandle GetProcess() const OVERRIDE; | 471 virtual base::ProcessHandle GetProcess() const OVERRIDE; |
| 466 virtual Type GetType() const OVERRIDE; | 472 virtual Type GetType() const OVERRIDE; |
| 467 | 473 |
| 468 virtual bool SupportNetworkUsage() const OVERRIDE; | 474 virtual bool SupportNetworkUsage() const OVERRIDE; |
| 469 virtual void SetSupportNetworkUsage() OVERRIDE; | 475 virtual void SetSupportNetworkUsage() OVERRIDE; |
| 470 | 476 |
| 471 virtual bool ReportsSqliteMemoryUsed() const OVERRIDE; | 477 virtual bool ReportsSqliteMemoryUsed() const OVERRIDE; |
| 472 virtual size_t SqliteMemoryUsedBytes() const OVERRIDE; | 478 virtual size_t SqliteMemoryUsedBytes() const OVERRIDE; |
| 473 | 479 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 511 |
| 506 void AddToTaskManager(ChildProcessInfo child_process_info); | 512 void AddToTaskManager(ChildProcessInfo child_process_info); |
| 507 | 513 |
| 508 TaskManager* task_manager_; | 514 TaskManager* task_manager_; |
| 509 TaskManagerBrowserProcessResource resource_; | 515 TaskManagerBrowserProcessResource resource_; |
| 510 | 516 |
| 511 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); | 517 DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResourceProvider); |
| 512 }; | 518 }; |
| 513 | 519 |
| 514 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ | 520 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_RESOURCE_PROVIDERS_H_ |
| OLD | NEW |