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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 67253003: Reland: Move ExtensionProcessManager to src/extensions, part 4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase process_manager Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/extensions/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/app_restore_service.h" 8 #include "apps/app_restore_service.h"
9 #include "apps/saved_files_service.h" 9 #include "apps/saved_files_service.h"
10 #include "apps/shell_window.h" 10 #include "apps/shell_window.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 pref_registrar_.Init(profile->GetPrefs()); 1070 pref_registrar_.Init(profile->GetPrefs());
1071 pref_registrar_.Add(prefs::kExtensionInstallDenyList, callback); 1071 pref_registrar_.Add(prefs::kExtensionInstallDenyList, callback);
1072 } 1072 }
1073 1073
1074 std::vector<ExtensionPage> 1074 std::vector<ExtensionPage>
1075 ExtensionSettingsHandler::GetInspectablePagesForExtension( 1075 ExtensionSettingsHandler::GetInspectablePagesForExtension(
1076 const Extension* extension, bool extension_is_enabled) { 1076 const Extension* extension, bool extension_is_enabled) {
1077 std::vector<ExtensionPage> result; 1077 std::vector<ExtensionPage> result;
1078 1078
1079 // Get the extension process's active views. 1079 // Get the extension process's active views.
1080 ExtensionProcessManager* process_manager = 1080 extensions::ProcessManager* process_manager =
1081 ExtensionSystem::Get(extension_service_->profile())->process_manager(); 1081 ExtensionSystem::Get(extension_service_->profile())->process_manager();
1082 GetInspectablePagesForExtensionProcess( 1082 GetInspectablePagesForExtensionProcess(
1083 extension, 1083 extension,
1084 process_manager->GetRenderViewHostsForExtension(extension->id()), 1084 process_manager->GetRenderViewHostsForExtension(extension->id()),
1085 &result); 1085 &result);
1086 1086
1087 // Get shell window views 1087 // Get shell window views
1088 GetShellWindowPagesForExtensionProfile(extension, 1088 GetShellWindowPagesForExtensionProfile(extension,
1089 extension_service_->profile(), &result); 1089 extension_service_->profile(), &result);
1090 1090
1091 // Include a link to start the lazy background page, if applicable. 1091 // Include a link to start the lazy background page, if applicable.
1092 if (BackgroundInfo::HasLazyBackgroundPage(extension) && 1092 if (BackgroundInfo::HasLazyBackgroundPage(extension) &&
1093 extension_is_enabled && 1093 extension_is_enabled &&
1094 !process_manager->GetBackgroundHostForExtension(extension->id())) { 1094 !process_manager->GetBackgroundHostForExtension(extension->id())) {
1095 result.push_back(ExtensionPage( 1095 result.push_back(ExtensionPage(
1096 BackgroundInfo::GetBackgroundURL(extension), 1096 BackgroundInfo::GetBackgroundURL(extension),
1097 -1, 1097 -1,
1098 -1, 1098 -1,
1099 false, 1099 false,
1100 BackgroundInfo::HasGeneratedBackgroundPage(extension))); 1100 BackgroundInfo::HasGeneratedBackgroundPage(extension)));
1101 } 1101 }
1102 1102
1103 // Repeat for the incognito process, if applicable. Don't try to get 1103 // Repeat for the incognito process, if applicable. Don't try to get
1104 // shell windows for incognito processes. 1104 // shell windows for incognito processes.
1105 if (extension_service_->profile()->HasOffTheRecordProfile() && 1105 if (extension_service_->profile()->HasOffTheRecordProfile() &&
1106 IncognitoInfo::IsSplitMode(extension)) { 1106 IncognitoInfo::IsSplitMode(extension)) {
1107 ExtensionProcessManager* process_manager = 1107 extensions::ProcessManager* process_manager =
1108 ExtensionSystem::Get(extension_service_->profile()-> 1108 ExtensionSystem::Get(extension_service_->profile()->
1109 GetOffTheRecordProfile())->process_manager(); 1109 GetOffTheRecordProfile())->process_manager();
1110 GetInspectablePagesForExtensionProcess( 1110 GetInspectablePagesForExtensionProcess(
1111 extension, 1111 extension,
1112 process_manager->GetRenderViewHostsForExtension(extension->id()), 1112 process_manager->GetRenderViewHostsForExtension(extension->id()),
1113 &result); 1113 &result);
1114 1114
1115 if (BackgroundInfo::HasLazyBackgroundPage(extension) && 1115 if (BackgroundInfo::HasLazyBackgroundPage(extension) &&
1116 extension_is_enabled && 1116 extension_is_enabled &&
1117 !process_manager->GetBackgroundHostForExtension(extension->id())) { 1117 !process_manager->GetBackgroundHostForExtension(extension->id())) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 extension_service_->EnableExtension(extension_id); 1208 extension_service_->EnableExtension(extension_id);
1209 } else { 1209 } else {
1210 ExtensionErrorReporter::GetInstance()->ReportError( 1210 ExtensionErrorReporter::GetInstance()->ReportError(
1211 UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1211 UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1212 true /* be noisy */); 1212 true /* be noisy */);
1213 } 1213 }
1214 requirements_checker_.reset(); 1214 requirements_checker_.reset();
1215 } 1215 }
1216 1216
1217 } // namespace extensions 1217 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/select_file_dialog_extension.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698