OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" | 5 #include "extensions/browser/api/guest_view/web_view/web_view_internal_api.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
723 } | 723 } |
724 | 724 |
725 WebViewInternalReloadFunction::~WebViewInternalReloadFunction() { | 725 WebViewInternalReloadFunction::~WebViewInternalReloadFunction() { |
726 } | 726 } |
727 | 727 |
728 bool WebViewInternalReloadFunction::RunAsyncSafe(WebViewGuest* guest) { | 728 bool WebViewInternalReloadFunction::RunAsyncSafe(WebViewGuest* guest) { |
729 guest->Reload(); | 729 guest->Reload(); |
730 return true; | 730 return true; |
731 } | 731 } |
732 | 732 |
733 WebViewInternalReportExtensionIdFunction:: | |
734 WebViewInternalReportExtensionIdFunction() { | |
735 } | |
736 | |
737 WebViewInternalReportExtensionIdFunction:: | |
738 ~WebViewInternalReportExtensionIdFunction() { | |
739 } | |
740 | |
741 bool WebViewInternalReportExtensionIdFunction::RunAsync() { | |
742 scoped_ptr<web_view_internal::ReportExtensionId::Params> params( | |
743 web_view_internal::ReportExtensionId::Params::Create(*args_)); | |
744 EXTENSION_FUNCTION_VALIDATE(params.get()); | |
745 | |
746 // Some WebViews are not in extensions. This is not an error, so |true| is | |
747 // still returned. | |
748 if (!extension()) | |
749 return true; | |
750 | |
751 WebViewGuest::RegisterExtensionID(extension_id(), | |
Devlin
2015/07/06 17:46:18
This is a pretty bad hack. This is basically hopi
| |
752 render_frame_host()->GetProcess()->GetID(), | |
753 params->view_instance_id); | |
754 return true; | |
755 } | |
756 | |
733 WebViewInternalSetPermissionFunction::WebViewInternalSetPermissionFunction() { | 757 WebViewInternalSetPermissionFunction::WebViewInternalSetPermissionFunction() { |
734 } | 758 } |
735 | 759 |
736 WebViewInternalSetPermissionFunction::~WebViewInternalSetPermissionFunction() { | 760 WebViewInternalSetPermissionFunction::~WebViewInternalSetPermissionFunction() { |
737 } | 761 } |
738 | 762 |
739 bool WebViewInternalSetPermissionFunction::RunAsyncSafe(WebViewGuest* guest) { | 763 bool WebViewInternalSetPermissionFunction::RunAsyncSafe(WebViewGuest* guest) { |
740 scoped_ptr<web_view_internal::SetPermission::Params> params( | 764 scoped_ptr<web_view_internal::SetPermission::Params> params( |
741 web_view_internal::SetPermission::Params::Create(*args_)); | 765 web_view_internal::SetPermission::Params::Create(*args_)); |
742 EXTENSION_FUNCTION_VALIDATE(params.get()); | 766 EXTENSION_FUNCTION_VALIDATE(params.get()); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
892 // Will finish asynchronously. | 916 // Will finish asynchronously. |
893 return true; | 917 return true; |
894 } | 918 } |
895 | 919 |
896 void WebViewInternalClearDataFunction::ClearDataDone() { | 920 void WebViewInternalClearDataFunction::ClearDataDone() { |
897 Release(); // Balanced in RunAsync(). | 921 Release(); // Balanced in RunAsync(). |
898 SendResponse(true); | 922 SendResponse(true); |
899 } | 923 } |
900 | 924 |
901 } // namespace extensions | 925 } // namespace extensions |
OLD | NEW |