OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 6722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6733 } | 6733 } |
6734 | 6734 |
6735 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { | 6735 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { |
6736 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( | 6736 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( |
6737 PepperPluginInstance::Get(pp_instance)); | 6737 PepperPluginInstance::Get(pp_instance)); |
6738 if (instance) | 6738 if (instance) |
6739 instance->audio_controller().SetVolume(volume); | 6739 instance->audio_controller().SetVolume(volume); |
6740 } | 6740 } |
6741 #endif // ENABLE_PLUGINS | 6741 #endif // ENABLE_PLUGINS |
6742 | 6742 |
| 6743 void RenderFrameImpl::ShowCreatedWindow(bool opened_by_user_gesture, |
| 6744 RenderWidget* render_widget_to_show, |
| 6745 WebNavigationPolicy policy, |
| 6746 const gfx::Rect& initial_rect) { |
| 6747 // |render_widget_to_show| is the main RenderWidget for a pending window |
| 6748 // created by this object, but not yet shown. The tab is currently offscreen, |
| 6749 // and still owned by the opener. Sending |FrameHostMsg_ShowCreatedWindow| |
| 6750 // will move it off the opener's pending list, and put it in its own tab or |
| 6751 // window. |
| 6752 // |
| 6753 // This call happens only for renderer-created windows; for example, when a |
| 6754 // tab is created by script via window.open(). |
| 6755 Send(new FrameHostMsg_ShowCreatedWindow( |
| 6756 GetRoutingID(), render_widget_to_show->routing_id(), |
| 6757 RenderViewImpl::NavigationPolicyToDisposition(policy), initial_rect, |
| 6758 opened_by_user_gesture)); |
| 6759 } |
| 6760 |
6743 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) { | 6761 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) { |
6744 #if BUILDFLAG(ENABLE_PLUGINS) | 6762 #if BUILDFLAG(ENABLE_PLUGINS) |
6745 // Notify all Pepper plugins. | 6763 // Notify all Pepper plugins. |
6746 for (auto* plugin : active_pepper_instances_) | 6764 for (auto* plugin : active_pepper_instances_) |
6747 plugin->SetContentAreaFocus(enable); | 6765 plugin->SetContentAreaFocus(enable); |
6748 #endif | 6766 #endif |
6749 } | 6767 } |
6750 | 6768 |
6751 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() { | 6769 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() { |
6752 #if BUILDFLAG(ENABLE_PLUGINS) | 6770 #if BUILDFLAG(ENABLE_PLUGINS) |
6753 // This method is called for every mouse event that the RenderWidget receives. | 6771 // This method is called for every mouse event that the RenderWidget receives. |
6754 // And then the mouse event is forwarded to blink, which dispatches it to the | 6772 // And then the mouse event is forwarded to blink, which dispatches it to the |
6755 // event target. Potentially a Pepper plugin will receive the event. | 6773 // event target. Potentially a Pepper plugin will receive the event. |
6756 // In order to tell whether a plugin gets the last mouse event and which it | 6774 // In order to tell whether a plugin gets the last mouse event and which it |
6757 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6775 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6758 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6776 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6759 // |pepper_last_mouse_event_target_|. | 6777 // |pepper_last_mouse_event_target_|. |
6760 pepper_last_mouse_event_target_ = nullptr; | 6778 pepper_last_mouse_event_target_ = nullptr; |
6761 #endif | 6779 #endif |
6762 } | 6780 } |
6763 | 6781 |
6764 } // namespace content | 6782 } // namespace content |
OLD | NEW |