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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 | 1097 |
1098 // Counts the number of extension background pages associated with this profile. | 1098 // Counts the number of extension background pages associated with this profile. |
1099 int CountExtensionBackgroundPagesForProfile(Profile* profile) { | 1099 int CountExtensionBackgroundPagesForProfile(Profile* profile) { |
1100 int count = 0; | 1100 int count = 0; |
1101 ExtensionProcessManager* manager = profile->GetExtensionProcessManager(); | 1101 ExtensionProcessManager* manager = profile->GetExtensionProcessManager(); |
1102 if (!manager) | 1102 if (!manager) |
1103 return count; | 1103 return count; |
1104 for (ExtensionProcessManager::const_iterator iter = manager->begin(); | 1104 for (ExtensionProcessManager::const_iterator iter = manager->begin(); |
1105 iter != manager->end(); | 1105 iter != manager->end(); |
1106 ++iter) { | 1106 ++iter) { |
1107 if ((*iter)->GetRenderViewType() == | 1107 if ((*iter)->extension_host_type() == |
1108 chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { | 1108 chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { |
1109 count++; | 1109 count++; |
1110 } | 1110 } |
1111 } | 1111 } |
1112 return count; | 1112 return count; |
1113 } | 1113 } |
1114 | 1114 |
1115 } // namespace | 1115 } // namespace |
1116 | 1116 |
1117 // static | 1117 // static |
(...skipping 18 matching lines...) Expand all Loading... |
1136 // Count the number of extensions with background pages (including | 1136 // Count the number of extensions with background pages (including |
1137 // incognito). | 1137 // incognito). |
1138 count += CountExtensionBackgroundPagesForProfile(profile); | 1138 count += CountExtensionBackgroundPagesForProfile(profile); |
1139 if (profile->HasOffTheRecordProfile()) { | 1139 if (profile->HasOffTheRecordProfile()) { |
1140 count += CountExtensionBackgroundPagesForProfile( | 1140 count += CountExtensionBackgroundPagesForProfile( |
1141 profile->GetOffTheRecordProfile()); | 1141 profile->GetOffTheRecordProfile()); |
1142 } | 1142 } |
1143 } | 1143 } |
1144 return count; | 1144 return count; |
1145 } | 1145 } |
OLD | NEW |