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 #include "chrome/browser/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/i18n/number_formatting.h" | 8 #include "base/i18n/number_formatting.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 goat_salt_(rand()) { | 79 goat_salt_(rand()) { |
80 AddResourceProvider( | 80 AddResourceProvider( |
81 new TaskManagerBrowserProcessResourceProvider(task_manager)); | 81 new TaskManagerBrowserProcessResourceProvider(task_manager)); |
82 AddResourceProvider( | 82 AddResourceProvider( |
83 new TaskManagerBackgroundContentsResourceProvider(task_manager)); | 83 new TaskManagerBackgroundContentsResourceProvider(task_manager)); |
84 AddResourceProvider(new TaskManagerTabContentsResourceProvider(task_manager)); | 84 AddResourceProvider(new TaskManagerTabContentsResourceProvider(task_manager)); |
85 AddResourceProvider( | 85 AddResourceProvider( |
86 new TaskManagerChildProcessResourceProvider(task_manager)); | 86 new TaskManagerChildProcessResourceProvider(task_manager)); |
87 AddResourceProvider( | 87 AddResourceProvider( |
88 new TaskManagerExtensionProcessResourceProvider(task_manager)); | 88 new TaskManagerExtensionProcessResourceProvider(task_manager)); |
89 AddResourceProvider( | 89 |
90 new TaskManagerNotificationResourceProvider(task_manager)); | 90 TaskManager::ResourceProvider* provider = |
| 91 TaskManagerNotificationResourceProvider::Create(task_manager); |
| 92 if (provider) |
| 93 AddResourceProvider(provider); |
91 } | 94 } |
92 | 95 |
93 TaskManagerModel::~TaskManagerModel() { | 96 TaskManagerModel::~TaskManagerModel() { |
94 for (ResourceProviderList::iterator iter = providers_.begin(); | 97 for (ResourceProviderList::iterator iter = providers_.begin(); |
95 iter != providers_.end(); ++iter) { | 98 iter != providers_.end(); ++iter) { |
96 (*iter)->Release(); | 99 (*iter)->Release(); |
97 } | 100 } |
98 } | 101 } |
99 | 102 |
100 int TaskManagerModel::ResourceCount() const { | 103 int TaskManagerModel::ResourceCount() const { |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 // Count the number of extensions with background pages (including | 1033 // Count the number of extensions with background pages (including |
1031 // incognito). | 1034 // incognito). |
1032 count += CountExtensionBackgroundPagesForProfile(profile); | 1035 count += CountExtensionBackgroundPagesForProfile(profile); |
1033 if (profile->HasOffTheRecordProfile()) { | 1036 if (profile->HasOffTheRecordProfile()) { |
1034 count += CountExtensionBackgroundPagesForProfile( | 1037 count += CountExtensionBackgroundPagesForProfile( |
1035 profile->GetOffTheRecordProfile()); | 1038 profile->GetOffTheRecordProfile()); |
1036 } | 1039 } |
1037 } | 1040 } |
1038 return count; | 1041 return count; |
1039 } | 1042 } |
OLD | NEW |