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

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

Issue 8205011: Task manager: Properly observe background contents from incognito profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager/task_manager_resource_providers.cc
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
index 2ce1d6a18b442846e8d33952d6c9ee89604fd98f..49cc7b0b8ee35651351ec5ed29fd6a011148d71f 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -567,23 +567,30 @@ void TaskManagerBackgroundContentsResourceProvider::StartUpdating() {
DCHECK(!updating_);
updating_ = true;
- // Add all the existing BackgroundContents from every profile.
+ // Add all the existing BackgroundContents from every profile, including
+ // incognito profiles.
ProfileManager* profile_manager = g_browser_process->profile_manager();
std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles());
+ size_t num_default_profiles = profiles.size();
+ for (size_t i = 0; i < num_default_profiles; ++i) {
+ if (profiles[i]->HasOffTheRecordProfile()) {
+ profiles.push_back(profiles[i]->GetOffTheRecordProfile());
+ }
+ }
for (size_t i = 0; i < profiles.size(); ++i) {
BackgroundContentsService* background_contents_service =
BackgroundContentsServiceFactory::GetForProfile(profiles[i]);
- ExtensionService* extensions_service = profiles[i]->GetExtensionService();
std::vector<BackgroundContents*> contents =
background_contents_service->GetBackgroundContents();
+ ExtensionService* extension_service = profiles[i]->GetExtensionService();
for (std::vector<BackgroundContents*>::iterator iterator = contents.begin();
iterator != contents.end(); ++iterator) {
string16 application_name;
// Lookup the name from the parent extension.
- if (extensions_service) {
+ if (extension_service) {
const string16& application_id =
background_contents_service->GetParentApplicationId(*iterator);
- const Extension* extension = extensions_service->GetExtensionById(
+ const Extension* extension = extension_service->GetExtensionById(
UTF16ToUTF8(application_id), false);
if (extension)
application_name = UTF8ToUTF16(extension->name());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698