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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 CHECK(args->GetString(2, &render_view_id_str)); | 789 CHECK(args->GetString(2, &render_view_id_str)); |
790 CHECK(args->GetBoolean(3, &incognito)); | 790 CHECK(args->GetBoolean(3, &incognito)); |
791 CHECK(base::StringToInt(render_process_id_str, &render_process_id)); | 791 CHECK(base::StringToInt(render_process_id_str, &render_process_id)); |
792 CHECK(base::StringToInt(render_view_id_str, &render_view_id)); | 792 CHECK(base::StringToInt(render_view_id_str, &render_view_id)); |
793 | 793 |
794 if (render_process_id == -1) { | 794 if (render_process_id == -1) { |
795 // This message is for a lazy background page. Start the page if necessary. | 795 // This message is for a lazy background page. Start the page if necessary. |
796 const Extension* extension = | 796 const Extension* extension = |
797 extension_service_->extensions()->GetByID(extension_id); | 797 extension_service_->extensions()->GetByID(extension_id); |
798 DCHECK(extension); | 798 DCHECK(extension); |
799 devtools_util::InspectBackgroundPage(extension, | 799 Profile* profile = Profile::FromWebUI(web_ui()); |
800 Profile::FromWebUI(web_ui())); | 800 if (incognito) |
| 801 profile = profile->GetOffTheRecordProfile(); |
| 802 devtools_util::InspectBackgroundPage(extension, profile); |
801 return; | 803 return; |
802 } | 804 } |
803 | 805 |
804 RenderViewHost* host = RenderViewHost::FromID(render_process_id, | 806 RenderViewHost* host = RenderViewHost::FromID(render_process_id, |
805 render_view_id); | 807 render_view_id); |
806 if (!host) { | 808 if (!host) { |
807 // This can happen if the host has gone away since the page was displayed. | 809 // This can happen if the host has gone away since the page was displayed. |
808 return; | 810 return; |
809 } | 811 } |
810 | 812 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 BackgroundInfo::GetBackgroundURL(extension), | 1129 BackgroundInfo::GetBackgroundURL(extension), |
1128 -1, | 1130 -1, |
1129 -1, | 1131 -1, |
1130 false, | 1132 false, |
1131 BackgroundInfo::HasGeneratedBackgroundPage(extension))); | 1133 BackgroundInfo::HasGeneratedBackgroundPage(extension))); |
1132 } | 1134 } |
1133 | 1135 |
1134 // Repeat for the incognito process, if applicable. Don't try to get | 1136 // Repeat for the incognito process, if applicable. Don't try to get |
1135 // shell windows for incognito processes. | 1137 // shell windows for incognito processes. |
1136 if (extension_service_->profile()->HasOffTheRecordProfile() && | 1138 if (extension_service_->profile()->HasOffTheRecordProfile() && |
1137 IncognitoInfo::IsSplitMode(extension)) { | 1139 IncognitoInfo::IsSplitMode(extension) && |
| 1140 extension_util::IsIncognitoEnabled(extension->id(), extension_service_)) { |
1138 extensions::ProcessManager* process_manager = | 1141 extensions::ProcessManager* process_manager = |
1139 ExtensionSystem::Get(extension_service_->profile()-> | 1142 ExtensionSystem::Get(extension_service_->profile()-> |
1140 GetOffTheRecordProfile())->process_manager(); | 1143 GetOffTheRecordProfile())->process_manager(); |
1141 GetInspectablePagesForExtensionProcess( | 1144 GetInspectablePagesForExtensionProcess( |
1142 extension, | 1145 extension, |
1143 process_manager->GetRenderViewHostsForExtension(extension->id()), | 1146 process_manager->GetRenderViewHostsForExtension(extension->id()), |
1144 &result); | 1147 &result); |
1145 | 1148 |
1146 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 1149 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
1147 extension_is_enabled && | 1150 extension_is_enabled && |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 extension_service_->EnableExtension(extension_id); | 1242 extension_service_->EnableExtension(extension_id); |
1240 } else { | 1243 } else { |
1241 ExtensionErrorReporter::GetInstance()->ReportError( | 1244 ExtensionErrorReporter::GetInstance()->ReportError( |
1242 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1245 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1243 true /* be noisy */); | 1246 true /* be noisy */); |
1244 } | 1247 } |
1245 requirements_checker_.reset(); | 1248 requirements_checker_.reset(); |
1246 } | 1249 } |
1247 | 1250 |
1248 } // namespace extensions | 1251 } // namespace extensions |
OLD | NEW |