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/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 // Wakes up the background page and opens the inspect window. | 890 // Wakes up the background page and opens the inspect window. |
891 devtools_util::InspectBackgroundPage(extension, GetProfile()); | 891 devtools_util::InspectBackgroundPage(extension, GetProfile()); |
892 return false; | 892 return false; |
893 } | 893 } |
894 | 894 |
895 int render_view_id; | 895 int render_view_id; |
896 base::StringToInt(options.render_view_id, &render_view_id); | 896 base::StringToInt(options.render_view_id, &render_view_id); |
897 content::RenderViewHost* host = content::RenderViewHost::FromID( | 897 content::RenderViewHost* host = content::RenderViewHost::FromID( |
898 render_process_id, render_view_id); | 898 render_process_id, render_view_id); |
899 | 899 |
900 if (!host) { | 900 if (!host || !content::WebContents::FromRenderViewHost(host)) { |
901 // This can happen if the host has gone away since the page was displayed. | 901 // This can happen if the host has gone away since the page was displayed. |
902 return false; | 902 return false; |
903 } | 903 } |
904 | 904 |
905 DevToolsWindow::OpenDevToolsWindow(host); | 905 DevToolsWindow::OpenDevToolsWindow( |
| 906 content::WebContents::FromRenderViewHost(host)); |
906 return true; | 907 return true; |
907 } | 908 } |
908 | 909 |
909 DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} | 910 DeveloperPrivateInspectFunction::~DeveloperPrivateInspectFunction() {} |
910 | 911 |
911 bool DeveloperPrivateLoadUnpackedFunction::RunAsync() { | 912 bool DeveloperPrivateLoadUnpackedFunction::RunAsync() { |
912 base::string16 select_title = | 913 base::string16 select_title = |
913 l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); | 914 l10n_util::GetStringUTF16(IDS_EXTENSION_LOAD_FROM_DIRECTORY); |
914 | 915 |
915 // Balanced in FileSelected / FileSelectionCanceled. | 916 // Balanced in FileSelected / FileSelectionCanceled. |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 } | 1399 } |
1399 | 1400 |
1400 error_ui_util::HandleOpenDevTools(dict); | 1401 error_ui_util::HandleOpenDevTools(dict); |
1401 | 1402 |
1402 return true; | 1403 return true; |
1403 } | 1404 } |
1404 | 1405 |
1405 } // namespace api | 1406 } // namespace api |
1406 | 1407 |
1407 } // namespace extensions | 1408 } // namespace extensions |
OLD | NEW |