| 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_window.h" | 8 #include "apps/app_window.h" |
| 9 #include "apps/app_window_registry.h" | 9 #include "apps/app_window_registry.h" |
| 10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 DCHECK(extension); | 928 DCHECK(extension); |
| 929 Profile* profile = Profile::FromWebUI(web_ui()); | 929 Profile* profile = Profile::FromWebUI(web_ui()); |
| 930 if (incognito) | 930 if (incognito) |
| 931 profile = profile->GetOffTheRecordProfile(); | 931 profile = profile->GetOffTheRecordProfile(); |
| 932 devtools_util::InspectBackgroundPage(extension, profile); | 932 devtools_util::InspectBackgroundPage(extension, profile); |
| 933 return; | 933 return; |
| 934 } | 934 } |
| 935 | 935 |
| 936 RenderViewHost* host = RenderViewHost::FromID(render_process_id, | 936 RenderViewHost* host = RenderViewHost::FromID(render_process_id, |
| 937 render_view_id); | 937 render_view_id); |
| 938 if (!host) { | 938 if (!host || !WebContents::FromRenderViewHost(host)) { |
| 939 // This can happen if the host has gone away since the page was displayed. | 939 // This can happen if the host has gone away since the page was displayed. |
| 940 return; | 940 return; |
| 941 } | 941 } |
| 942 | 942 |
| 943 DevToolsWindow::OpenDevToolsWindow(host); | 943 DevToolsWindow::OpenDevToolsWindow(WebContents::FromRenderViewHost(host)); |
| 944 } | 944 } |
| 945 | 945 |
| 946 void ExtensionSettingsHandler::HandleLaunchMessage( | 946 void ExtensionSettingsHandler::HandleLaunchMessage( |
| 947 const base::ListValue* args) { | 947 const base::ListValue* args) { |
| 948 CHECK_EQ(1U, args->GetSize()); | 948 CHECK_EQ(1U, args->GetSize()); |
| 949 std::string extension_id; | 949 std::string extension_id; |
| 950 CHECK(args->GetString(0, &extension_id)); | 950 CHECK(args->GetString(0, &extension_id)); |
| 951 const Extension* extension = | 951 const Extension* extension = |
| 952 extension_service_->GetExtensionById(extension_id, false); | 952 extension_service_->GetExtensionById(extension_id, false); |
| 953 OpenApplication(AppLaunchParams(extension_service_->profile(), extension, | 953 OpenApplication(AppLaunchParams(extension_service_->profile(), extension, |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 extension_service_->EnableExtension(extension_id); | 1395 extension_service_->EnableExtension(extension_id); |
| 1396 } else { | 1396 } else { |
| 1397 ExtensionErrorReporter::GetInstance()->ReportError( | 1397 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1398 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1398 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1399 true); // Be noisy. | 1399 true); // Be noisy. |
| 1400 } | 1400 } |
| 1401 requirements_checker_.reset(); | 1401 requirements_checker_.reset(); |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 } // namespace extensions | 1404 } // namespace extensions |
| OLD | NEW |