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

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

Issue 23923010: Move Inspect[BackgroundPage|ExtensionHost] Out of ExtensionService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months 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
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 10 matching lines...) Expand all
21 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/values.h" 23 #include "base/values.h"
24 #include "base/version.h" 24 #include "base/version.h"
25 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
26 #include "chrome/browser/chrome_notification_types.h" 26 #include "chrome/browser/chrome_notification_types.h"
27 #include "chrome/browser/devtools/devtools_window.h" 27 #include "chrome/browser/devtools/devtools_window.h"
28 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 28 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
29 #include "chrome/browser/extensions/component_loader.h" 29 #include "chrome/browser/extensions/component_loader.h"
30 #include "chrome/browser/extensions/crx_installer.h" 30 #include "chrome/browser/extensions/crx_installer.h"
31 #include "chrome/browser/extensions/devtools_util.h"
31 #include "chrome/browser/extensions/error_console/error_console.h" 32 #include "chrome/browser/extensions/error_console/error_console.h"
32 #include "chrome/browser/extensions/extension_action_manager.h" 33 #include "chrome/browser/extensions/extension_action_manager.h"
33 #include "chrome/browser/extensions/extension_disabled_ui.h" 34 #include "chrome/browser/extensions/extension_disabled_ui.h"
34 #include "chrome/browser/extensions/extension_error_reporter.h" 35 #include "chrome/browser/extensions/extension_error_reporter.h"
35 #include "chrome/browser/extensions/extension_host.h" 36 #include "chrome/browser/extensions/extension_host.h"
36 #include "chrome/browser/extensions/extension_service.h" 37 #include "chrome/browser/extensions/extension_service.h"
37 #include "chrome/browser/extensions/extension_system.h" 38 #include "chrome/browser/extensions/extension_system.h"
38 #include "chrome/browser/extensions/extension_tab_util.h" 39 #include "chrome/browser/extensions/extension_tab_util.h"
39 #include "chrome/browser/extensions/extension_warning_set.h" 40 #include "chrome/browser/extensions/extension_warning_set.h"
40 #include "chrome/browser/extensions/lazy_background_task_queue.h" 41 #include "chrome/browser/extensions/lazy_background_task_queue.h"
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 CHECK(args->GetString(2, &render_view_id_str)); 722 CHECK(args->GetString(2, &render_view_id_str));
722 CHECK(args->GetBoolean(3, &incognito)); 723 CHECK(args->GetBoolean(3, &incognito));
723 CHECK(base::StringToInt(render_process_id_str, &render_process_id)); 724 CHECK(base::StringToInt(render_process_id_str, &render_process_id));
724 CHECK(base::StringToInt(render_view_id_str, &render_view_id)); 725 CHECK(base::StringToInt(render_view_id_str, &render_view_id));
725 726
726 if (render_process_id == -1) { 727 if (render_process_id == -1) {
727 // This message is for a lazy background page. Start the page if necessary. 728 // This message is for a lazy background page. Start the page if necessary.
728 const Extension* extension = 729 const Extension* extension =
729 extension_service_->extensions()->GetByID(extension_id); 730 extension_service_->extensions()->GetByID(extension_id);
730 DCHECK(extension); 731 DCHECK(extension);
731 732 devtools_util::InspectBackgroundPage(extension,
732 ExtensionService* service = extension_service_; 733 Profile::FromWebUI(web_ui()));
733 if (incognito)
734 service = ExtensionSystem::Get(extension_service_->
735 profile()->GetOffTheRecordProfile())->extension_service();
736
737 service->InspectBackgroundPage(extension);
738 return; 734 return;
739 } 735 }
740 736
741 RenderViewHost* host = RenderViewHost::FromID(render_process_id, 737 RenderViewHost* host = RenderViewHost::FromID(render_process_id,
742 render_view_id); 738 render_view_id);
743 if (!host) { 739 if (!host) {
744 // This can happen if the host has gone away since the page was displayed. 740 // This can happen if the host has gone away since the page was displayed.
745 return; 741 return;
746 } 742 }
747 743
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 extension_service_->EnableExtension(extension_id); 1165 extension_service_->EnableExtension(extension_id);
1170 } else { 1166 } else {
1171 ExtensionErrorReporter::GetInstance()->ReportError( 1167 ExtensionErrorReporter::GetInstance()->ReportError(
1172 UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1168 UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1173 true /* be noisy */); 1169 true /* be noisy */);
1174 } 1170 }
1175 requirements_checker_.reset(); 1171 requirements_checker_.reset();
1176 } 1172 }
1177 1173
1178 } // namespace extensions 1174 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698