| 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3751 const std::string& name, | 3751 const std::string& name, |
| 3752 const base::ListValue& args) { | 3752 const base::ListValue& args) { |
| 3753 if (delegate_) | 3753 if (delegate_) |
| 3754 delegate_->WebUISend(this, source_url, name, args); | 3754 delegate_->WebUISend(this, source_url, name, args); |
| 3755 } | 3755 } |
| 3756 | 3756 |
| 3757 #if BUILDFLAG(ENABLE_PLUGINS) | 3757 #if BUILDFLAG(ENABLE_PLUGINS) |
| 3758 void WebContentsImpl::OnPepperInstanceCreated(int32_t pp_instance) { | 3758 void WebContentsImpl::OnPepperInstanceCreated(int32_t pp_instance) { |
| 3759 for (auto& observer : observers_) | 3759 for (auto& observer : observers_) |
| 3760 observer.PepperInstanceCreated(); | 3760 observer.PepperInstanceCreated(); |
| 3761 pepper_playback_observer_->PepperInstanceCreated(pp_instance); | 3761 pepper_playback_observer_->PepperInstanceCreated( |
| 3762 render_frame_message_source_, pp_instance); |
| 3762 } | 3763 } |
| 3763 | 3764 |
| 3764 void WebContentsImpl::OnPepperInstanceDeleted(int32_t pp_instance) { | 3765 void WebContentsImpl::OnPepperInstanceDeleted(int32_t pp_instance) { |
| 3765 for (auto& observer : observers_) | 3766 for (auto& observer : observers_) |
| 3766 observer.PepperInstanceDeleted(); | 3767 observer.PepperInstanceDeleted(); |
| 3767 pepper_playback_observer_->PepperInstanceDeleted(pp_instance); | 3768 pepper_playback_observer_->PepperInstanceDeleted( |
| 3769 render_frame_message_source_, pp_instance); |
| 3768 } | 3770 } |
| 3769 | 3771 |
| 3770 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, | 3772 void WebContentsImpl::OnPepperPluginHung(int plugin_child_id, |
| 3771 const base::FilePath& path, | 3773 const base::FilePath& path, |
| 3772 bool is_hung) { | 3774 bool is_hung) { |
| 3773 UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1); | 3775 UMA_HISTOGRAM_COUNTS("Pepper.PluginHung", 1); |
| 3774 | 3776 |
| 3775 for (auto& observer : observers_) | 3777 for (auto& observer : observers_) |
| 3776 observer.PluginHungStatusChanged(plugin_child_id, path, is_hung); | 3778 observer.PluginHungStatusChanged(plugin_child_id, path, is_hung); |
| 3777 } | 3779 } |
| 3778 | 3780 |
| 3779 void WebContentsImpl::OnPepperStartsPlayback(int32_t pp_instance) { | 3781 void WebContentsImpl::OnPepperStartsPlayback(int32_t pp_instance) { |
| 3780 pepper_playback_observer_->PepperStartsPlayback(pp_instance); | 3782 pepper_playback_observer_->PepperStartsPlayback( |
| 3783 render_frame_message_source_, pp_instance); |
| 3781 } | 3784 } |
| 3782 | 3785 |
| 3783 void WebContentsImpl::OnPepperStopsPlayback(int32_t pp_instance) { | 3786 void WebContentsImpl::OnPepperStopsPlayback(int32_t pp_instance) { |
| 3784 pepper_playback_observer_->PepperStopsPlayback(pp_instance); | 3787 pepper_playback_observer_->PepperStopsPlayback( |
| 3788 render_frame_message_source_, pp_instance); |
| 3785 } | 3789 } |
| 3786 | 3790 |
| 3787 void WebContentsImpl::OnPluginCrashed(const base::FilePath& plugin_path, | 3791 void WebContentsImpl::OnPluginCrashed(const base::FilePath& plugin_path, |
| 3788 base::ProcessId plugin_pid) { | 3792 base::ProcessId plugin_pid) { |
| 3789 for (auto& observer : observers_) | 3793 for (auto& observer : observers_) |
| 3790 observer.PluginCrashed(plugin_path, plugin_pid); | 3794 observer.PluginCrashed(plugin_path, plugin_pid); |
| 3791 } | 3795 } |
| 3792 | 3796 |
| 3793 void WebContentsImpl::OnRequestPpapiBrokerPermission( | 3797 void WebContentsImpl::OnRequestPpapiBrokerPermission( |
| 3794 int routing_id, | 3798 int routing_id, |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4075 } | 4079 } |
| 4076 #if defined(OS_ANDROID) | 4080 #if defined(OS_ANDROID) |
| 4077 render_frame_host->GetInterfaceRegistry()->AddInterface( | 4081 render_frame_host->GetInterfaceRegistry()->AddInterface( |
| 4078 GetJavaInterfaces()->CreateInterfaceFactory<device::nfc::mojom::NFC>()); | 4082 GetJavaInterfaces()->CreateInterfaceFactory<device::nfc::mojom::NFC>()); |
| 4079 #endif | 4083 #endif |
| 4080 } | 4084 } |
| 4081 | 4085 |
| 4082 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { | 4086 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { |
| 4083 for (auto& observer : observers_) | 4087 for (auto& observer : observers_) |
| 4084 observer.RenderFrameDeleted(render_frame_host); | 4088 observer.RenderFrameDeleted(render_frame_host); |
| 4089 #if BUILDFLAG(ENABLE_PLUGINS) |
| 4090 pepper_playback_observer_->RenderFrameDeleted(render_frame_host); |
| 4091 #endif |
| 4085 } | 4092 } |
| 4086 | 4093 |
| 4087 void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, | 4094 void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, |
| 4088 const ContextMenuParams& params) { | 4095 const ContextMenuParams& params) { |
| 4089 ContextMenuParams context_menu_params(params); | 4096 ContextMenuParams context_menu_params(params); |
| 4090 // Allow WebContentsDelegates to handle the context menu operation first. | 4097 // Allow WebContentsDelegates to handle the context menu operation first. |
| 4091 if (delegate_ && delegate_->HandleContextMenu(context_menu_params)) | 4098 if (delegate_ && delegate_->HandleContextMenu(context_menu_params)) |
| 4092 return; | 4099 return; |
| 4093 | 4100 |
| 4094 render_view_host_delegate_view_->ShowContextMenu(render_frame_host, | 4101 render_view_host_delegate_view_->ShowContextMenu(render_frame_host, |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5278 dialog_manager_ = dialog_manager; | 5285 dialog_manager_ = dialog_manager; |
| 5279 } | 5286 } |
| 5280 | 5287 |
| 5281 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5288 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5282 auto it = binding_sets_.find(interface_name); | 5289 auto it = binding_sets_.find(interface_name); |
| 5283 if (it != binding_sets_.end()) | 5290 if (it != binding_sets_.end()) |
| 5284 binding_sets_.erase(it); | 5291 binding_sets_.erase(it); |
| 5285 } | 5292 } |
| 5286 | 5293 |
| 5287 } // namespace content | 5294 } // namespace content |
| OLD | NEW |