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

Unified Diff: chrome/browser/task_manager/task_manager.cc

Issue 10790062: [Panels refactor] Track Panels in TaskManager now that they are not under the tab contents umbrella. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback changes Created 8 years, 5 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
« no previous file with comments | « chrome/browser/task_manager/task_manager.h ('k') | chrome/browser/task_manager/task_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/task_manager.cc
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index 71f113e33e9a7b8d6877ae55b3a414f54fada9da..9561a6d7f47fdce732d49197b1650642ae44d5e3 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
-#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/view_type.h"
@@ -94,6 +93,7 @@ TaskManagerModel::TaskManagerModel(TaskManager* task_manager)
AddResourceProvider(
new TaskManagerBackgroundContentsResourceProvider(task_manager));
AddResourceProvider(new TaskManagerTabContentsResourceProvider(task_manager));
+ AddResourceProvider(new TaskManagerPanelResourceProvider(task_manager));
AddResourceProvider(
new TaskManagerChildProcessResourceProvider(task_manager));
AddResourceProvider(
@@ -482,9 +482,9 @@ TaskManager::Resource::Type TaskManagerModel::GetResourceType(int index) const {
return resources_[index]->GetType();
}
-TabContents* TaskManagerModel::GetResourceTabContents(int index) const {
+WebContents* TaskManagerModel::GetResourceWebContents(int index) const {
CHECK_LT(index, ResourceCount());
- return resources_[index]->GetTabContents();
+ return resources_[index]->GetWebContents();
}
const extensions::Extension* TaskManagerModel::GetResourceExtension(
@@ -606,7 +606,7 @@ bool TaskManagerModel::GetV8MemoryUsed(int index, size_t* result) const {
bool TaskManagerModel::CanActivate(int index) const {
CHECK_LT(index, ResourceCount());
- return GetResourceTabContents(index) != NULL;
+ return GetResourceWebContents(index) != NULL;
}
bool TaskManagerModel::CanInspect(int index) const {
@@ -1096,15 +1096,13 @@ void TaskManager::KillProcess(int index) {
}
void TaskManager::ActivateProcess(int index) {
- // GetResourceTabContents returns a pointer to the relevant tab contents for
- // the resource. If the index doesn't correspond to a Tab (i.e. refers to
- // the Browser process or a plugin), GetTabContents will return NULL.
- TabContents* chosen_tab_contents = model_->GetResourceTabContents(index);
- if (chosen_tab_contents) {
- WebContents* web_contents = chosen_tab_contents->web_contents();
- if (web_contents->GetDelegate())
- web_contents->GetDelegate()->ActivateContents(web_contents);
- }
+ // GetResourceWebContents returns a pointer to the relevant web contents for
+ // the resource. If the index doesn't correspond to any web contents
+ // (i.e. refers to the Browser process or a plugin), GetWebContents will
+ // return NULL.
+ WebContents* chosen_web_contents = model_->GetResourceWebContents(index);
+ if (chosen_web_contents && chosen_web_contents->GetDelegate())
+ chosen_web_contents->GetDelegate()->ActivateContents(chosen_web_contents);
}
void TaskManager::AddResource(Resource* resource) {
« no previous file with comments | « chrome/browser/task_manager/task_manager.h ('k') | chrome/browser/task_manager/task_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698