| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "base/version.h" | 16 #include "base/version.h" |
| 17 #include "chrome/browser/debugger/devtools_window.h" | 17 #include "chrome/browser/debugger/devtools_window.h" |
| 18 #include "chrome/browser/extensions/crx_installer.h" | 18 #include "chrome/browser/extensions/crx_installer.h" |
| 19 #include "chrome/browser/extensions/extension_disabled_ui.h" | 19 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 20 #include "chrome/browser/extensions/extension_host.h" | 20 #include "chrome/browser/extensions/extension_host.h" |
| 21 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
| 22 #include "chrome/browser/extensions/extension_system.h" | 22 #include "chrome/browser/extensions/extension_system.h" |
| 23 #include "chrome/browser/extensions/extension_system_factory.h" | |
| 24 #include "chrome/browser/extensions/extension_warning_set.h" | 23 #include "chrome/browser/extensions/extension_warning_set.h" |
| 25 #include "chrome/browser/extensions/lazy_background_task_queue.h" | 24 #include "chrome/browser/extensions/lazy_background_task_queue.h" |
| 26 #include "chrome/browser/extensions/unpacked_installer.h" | 25 #include "chrome/browser/extensions/unpacked_installer.h" |
| 27 #include "chrome/browser/extensions/updater/extension_updater.h" | 26 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 28 #include "chrome/browser/google/google_util.h" | 27 #include "chrome/browser/google/google_util.h" |
| 29 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/browser/tab_contents/background_contents.h" | 29 #include "chrome/browser/tab_contents/background_contents.h" |
| 31 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 30 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 32 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
| 33 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 const Extension* extension = | 521 const Extension* extension = |
| 523 extension_service_->extensions()->GetByID(extension_id); | 522 extension_service_->extensions()->GetByID(extension_id); |
| 524 DCHECK(extension); | 523 DCHECK(extension); |
| 525 | 524 |
| 526 Profile* profile = extension_service_->profile(); | 525 Profile* profile = extension_service_->profile(); |
| 527 if (incognito) | 526 if (incognito) |
| 528 profile = profile->GetOffTheRecordProfile(); | 527 profile = profile->GetOffTheRecordProfile(); |
| 529 | 528 |
| 530 ExtensionProcessManager* pm = profile->GetExtensionProcessManager(); | 529 ExtensionProcessManager* pm = profile->GetExtensionProcessManager(); |
| 531 LazyBackgroundTaskQueue* queue = | 530 LazyBackgroundTaskQueue* queue = |
| 532 ExtensionSystemFactory::GetForProfile(profile)-> | 531 ExtensionSystem::Get(profile)->lazy_background_task_queue(); |
| 533 lazy_background_task_queue(); | |
| 534 | 532 |
| 535 ExtensionHost* host = pm->GetBackgroundHostForExtension(extension->id()); | 533 ExtensionHost* host = pm->GetBackgroundHostForExtension(extension->id()); |
| 536 if (host) { | 534 if (host) { |
| 537 InspectExtensionHost(host); | 535 InspectExtensionHost(host); |
| 538 } else { | 536 } else { |
| 539 queue->AddPendingTask( | 537 queue->AddPendingTask( |
| 540 profile, extension->id(), | 538 profile, extension->id(), |
| 541 base::Bind(&ExtensionSettingsHandler::InspectExtensionHost, | 539 base::Bind(&ExtensionSettingsHandler::InspectExtensionHost, |
| 542 base::Unretained(this))); | 540 base::Unretained(this))); |
| 543 } | 541 } |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 if (!extension_uninstall_dialog_.get()) { | 811 if (!extension_uninstall_dialog_.get()) { |
| 814 extension_uninstall_dialog_.reset( | 812 extension_uninstall_dialog_.reset( |
| 815 ExtensionUninstallDialog::Create(Profile::FromWebUI(web_ui()), this)); | 813 ExtensionUninstallDialog::Create(Profile::FromWebUI(web_ui()), this)); |
| 816 } | 814 } |
| 817 return extension_uninstall_dialog_.get(); | 815 return extension_uninstall_dialog_.get(); |
| 818 } | 816 } |
| 819 | 817 |
| 820 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { | 818 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { |
| 821 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); | 819 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); |
| 822 } | 820 } |
| OLD | NEW |