| OLD | NEW |
| 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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 pref_registrar_.Init(profile->GetPrefs()); | 1072 pref_registrar_.Init(profile->GetPrefs()); |
| 1073 pref_registrar_.Add(prefs::kExtensionInstallDenyList, callback); | 1073 pref_registrar_.Add(prefs::kExtensionInstallDenyList, callback); |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 std::vector<ExtensionPage> | 1076 std::vector<ExtensionPage> |
| 1077 ExtensionSettingsHandler::GetInspectablePagesForExtension( | 1077 ExtensionSettingsHandler::GetInspectablePagesForExtension( |
| 1078 const Extension* extension, bool extension_is_enabled) { | 1078 const Extension* extension, bool extension_is_enabled) { |
| 1079 std::vector<ExtensionPage> result; | 1079 std::vector<ExtensionPage> result; |
| 1080 | 1080 |
| 1081 // Get the extension process's active views. | 1081 // Get the extension process's active views. |
| 1082 ExtensionProcessManager* process_manager = | 1082 extensions::ProcessManager* process_manager = |
| 1083 ExtensionSystem::Get(extension_service_->profile())->process_manager(); | 1083 ExtensionSystem::Get(extension_service_->profile())->process_manager(); |
| 1084 GetInspectablePagesForExtensionProcess( | 1084 GetInspectablePagesForExtensionProcess( |
| 1085 extension, | 1085 extension, |
| 1086 process_manager->GetRenderViewHostsForExtension(extension->id()), | 1086 process_manager->GetRenderViewHostsForExtension(extension->id()), |
| 1087 &result); | 1087 &result); |
| 1088 | 1088 |
| 1089 // Get shell window views | 1089 // Get shell window views |
| 1090 GetShellWindowPagesForExtensionProfile(extension, | 1090 GetShellWindowPagesForExtensionProfile(extension, |
| 1091 extension_service_->profile(), &result); | 1091 extension_service_->profile(), &result); |
| 1092 | 1092 |
| 1093 // Include a link to start the lazy background page, if applicable. | 1093 // Include a link to start the lazy background page, if applicable. |
| 1094 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 1094 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 1095 extension_is_enabled && | 1095 extension_is_enabled && |
| 1096 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 1096 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
| 1097 result.push_back(ExtensionPage( | 1097 result.push_back(ExtensionPage( |
| 1098 BackgroundInfo::GetBackgroundURL(extension), | 1098 BackgroundInfo::GetBackgroundURL(extension), |
| 1099 -1, | 1099 -1, |
| 1100 -1, | 1100 -1, |
| 1101 false, | 1101 false, |
| 1102 BackgroundInfo::HasGeneratedBackgroundPage(extension))); | 1102 BackgroundInfo::HasGeneratedBackgroundPage(extension))); |
| 1103 } | 1103 } |
| 1104 | 1104 |
| 1105 // Repeat for the incognito process, if applicable. Don't try to get | 1105 // Repeat for the incognito process, if applicable. Don't try to get |
| 1106 // shell windows for incognito processes. | 1106 // shell windows for incognito processes. |
| 1107 if (extension_service_->profile()->HasOffTheRecordProfile() && | 1107 if (extension_service_->profile()->HasOffTheRecordProfile() && |
| 1108 IncognitoInfo::IsSplitMode(extension)) { | 1108 IncognitoInfo::IsSplitMode(extension)) { |
| 1109 ExtensionProcessManager* process_manager = | 1109 extensions::ProcessManager* process_manager = |
| 1110 ExtensionSystem::Get(extension_service_->profile()-> | 1110 ExtensionSystem::Get(extension_service_->profile()-> |
| 1111 GetOffTheRecordProfile())->process_manager(); | 1111 GetOffTheRecordProfile())->process_manager(); |
| 1112 GetInspectablePagesForExtensionProcess( | 1112 GetInspectablePagesForExtensionProcess( |
| 1113 extension, | 1113 extension, |
| 1114 process_manager->GetRenderViewHostsForExtension(extension->id()), | 1114 process_manager->GetRenderViewHostsForExtension(extension->id()), |
| 1115 &result); | 1115 &result); |
| 1116 | 1116 |
| 1117 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 1117 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 1118 extension_is_enabled && | 1118 extension_is_enabled && |
| 1119 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 1119 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 extension_service_->EnableExtension(extension_id); | 1210 extension_service_->EnableExtension(extension_id); |
| 1211 } else { | 1211 } else { |
| 1212 ExtensionErrorReporter::GetInstance()->ReportError( | 1212 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1213 UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1213 UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1214 true /* be noisy */); | 1214 true /* be noisy */); |
| 1215 } | 1215 } |
| 1216 requirements_checker_.reset(); | 1216 requirements_checker_.reset(); |
| 1217 } | 1217 } |
| 1218 | 1218 |
| 1219 } // namespace extensions | 1219 } // namespace extensions |
| OLD | NEW |