Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7893)

Unified Diff: chrome/browser/task_manager/background_resource_provider.h

Issue 15196003: Create task_manager namespace and wrap classes related to TaskManager with it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RendererResource Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/task_manager/background_resource_provider.h
diff --git a/chrome/browser/task_manager/task_manager_background_resource_provider.h b/chrome/browser/task_manager/background_resource_provider.h
similarity index 52%
rename from chrome/browser/task_manager/task_manager_background_resource_provider.h
rename to chrome/browser/task_manager/background_resource_provider.h
index 5051fc7fa652714e03ac6decdcfdc1637fa72b83..ecc3c403cb99aac6a6ba7148eab4b6b72fa40272 100644
--- a/chrome/browser/task_manager/task_manager_background_resource_provider.h
+++ b/chrome/browser/task_manager/background_resource_provider.h
@@ -2,54 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BACKGROUND_RESOURCE_PROVIDER_H_
-#define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BACKGROUND_RESOURCE_PROVIDER_H_
+#ifndef CHROME_BROWSER_TASK_MANAGER_BACKGROUND_RESOURCE_PROVIDER_H_
+#define CHROME_BROWSER_TASK_MANAGER_BACKGROUND_RESOURCE_PROVIDER_H_
#include <map>
#include "base/basictypes.h"
#include "base/string16.h"
#include "chrome/browser/task_manager/task_manager.h"
-#include "chrome/browser/task_manager/task_manager_render_resource.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-#include "ui/gfx/image/image_skia.h"
class BackgroundContents;
-class TaskManagerBackgroundContentsResource
- : public TaskManagerRendererResource {
- public:
- TaskManagerBackgroundContentsResource(
- BackgroundContents* background_contents,
- const string16& application_name);
- virtual ~TaskManagerBackgroundContentsResource();
-
- // TaskManager::Resource methods:
- virtual string16 GetTitle() const OVERRIDE;
- virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
- virtual bool IsBackground() const OVERRIDE;
-
- const string16& application_name() const { return application_name_; }
- private:
- BackgroundContents* background_contents_;
-
- string16 application_name_;
+namespace task_manager {
- // The icon painted for BackgroundContents.
- // TODO(atwilson): Use the favicon when there's a way to get the favicon for
- // BackgroundContents.
- static gfx::ImageSkia* default_icon_;
+class BackgroundContentsResource;
- DISALLOW_COPY_AND_ASSIGN(TaskManagerBackgroundContentsResource);
-};
-
-class TaskManagerBackgroundContentsResourceProvider
+class BackgroundContentsResourceProvider
: public TaskManager::ResourceProvider,
public content::NotificationObserver {
public:
- explicit TaskManagerBackgroundContentsResourceProvider(
+ explicit BackgroundContentsResourceProvider(
TaskManager* task_manager);
virtual TaskManager::Resource* GetResource(int origin_pid,
@@ -64,7 +38,7 @@ class TaskManagerBackgroundContentsResourceProvider
const content::NotificationDetails& details) OVERRIDE;
private:
- virtual ~TaskManagerBackgroundContentsResourceProvider();
+ virtual ~BackgroundContentsResourceProvider();
void Add(BackgroundContents* background_contents, const string16& title);
void Remove(BackgroundContents* background_contents);
@@ -80,14 +54,16 @@ class TaskManagerBackgroundContentsResourceProvider
// Maps the actual resources (the BackgroundContents) to the Task Manager
// resources.
- typedef std::map<BackgroundContents*, TaskManagerBackgroundContentsResource*>
+ typedef std::map<BackgroundContents*, BackgroundContentsResource*>
Resources;
Resources resources_;
// A scoped container for notification registries.
content::NotificationRegistrar registrar_;
- DISALLOW_COPY_AND_ASSIGN(TaskManagerBackgroundContentsResourceProvider);
+ DISALLOW_COPY_AND_ASSIGN(BackgroundContentsResourceProvider);
};
-#endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_BACKGROUND_RESOURCE_PROVIDER_H_
+} // namespace task_manager
+
+#endif // CHROME_BROWSER_TASK_MANAGER_BACKGROUND_RESOURCE_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698