Chromium Code Reviews| 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 6638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6649 } | 6649 } |
| 6650 | 6650 |
| 6651 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { | 6651 void RenderFrameImpl::OnSetPepperVolume(int32_t pp_instance, double volume) { |
| 6652 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( | 6652 PepperPluginInstanceImpl* instance = static_cast<PepperPluginInstanceImpl*>( |
| 6653 PepperPluginInstance::Get(pp_instance)); | 6653 PepperPluginInstance::Get(pp_instance)); |
| 6654 if (instance) | 6654 if (instance) |
| 6655 instance->audio_controller().SetVolume(volume); | 6655 instance->audio_controller().SetVolume(volume); |
| 6656 } | 6656 } |
| 6657 #endif // ENABLE_PLUGINS | 6657 #endif // ENABLE_PLUGINS |
| 6658 | 6658 |
| 6659 void RenderFrameImpl::ShowCreatedWindow(bool opened_by_user_gesture, | |
| 6660 RenderWidget* render_widget_to_show, | |
| 6661 WebNavigationPolicy policy, | |
| 6662 const gfx::Rect& initial_rect) { | |
| 6663 // |render_widget_to_show| is the main RenderWidget for a pending window | |
| 6664 // created by this object, but not yet shown. The tab is currently offscreen, | |
| 6665 // and still owned by the opener. Sending |FrameHostMsg_ShowCreatedWindow| | |
| 6666 // will move it off the opener's pending list, and put it in its own tab or | |
| 6667 // window. | |
| 6668 // | |
| 6669 // This call happens only for renderer-created windows; for example, when a | |
| 6670 // tab is created by script via window.open(). | |
| 6671 Send(new FrameHostMsg_ShowCreatedWindow( | |
| 6672 GetRoutingID(), render_widget_to_show->routing_id(), | |
| 6673 RenderViewImpl::NavigationPolicyToDisposition(policy), initial_rect, | |
|
alexmos
2016/12/13 18:41:41
Would it make sense to also move NavigationPolicyT
ncarter (slow)
2016/12/15 00:33:17
I actually looked into this before you even mentio
alexmos
2016/12/15 18:36:48
Acknowledged.
| |
| 6674 opened_by_user_gesture)); | |
| 6675 } | |
| 6676 | |
| 6659 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) { | 6677 void RenderFrameImpl::RenderWidgetSetFocus(bool enable) { |
| 6660 #if BUILDFLAG(ENABLE_PLUGINS) | 6678 #if BUILDFLAG(ENABLE_PLUGINS) |
| 6661 // Notify all Pepper plugins. | 6679 // Notify all Pepper plugins. |
| 6662 for (auto* plugin : active_pepper_instances_) | 6680 for (auto* plugin : active_pepper_instances_) |
| 6663 plugin->SetContentAreaFocus(enable); | 6681 plugin->SetContentAreaFocus(enable); |
| 6664 #endif | 6682 #endif |
| 6665 } | 6683 } |
| 6666 | 6684 |
| 6667 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() { | 6685 void RenderFrameImpl::RenderWidgetWillHandleMouseEvent() { |
| 6668 #if BUILDFLAG(ENABLE_PLUGINS) | 6686 #if BUILDFLAG(ENABLE_PLUGINS) |
| 6669 // This method is called for every mouse event that the RenderWidget receives. | 6687 // This method is called for every mouse event that the RenderWidget receives. |
| 6670 // And then the mouse event is forwarded to blink, which dispatches it to the | 6688 // And then the mouse event is forwarded to blink, which dispatches it to the |
| 6671 // event target. Potentially a Pepper plugin will receive the event. | 6689 // event target. Potentially a Pepper plugin will receive the event. |
| 6672 // In order to tell whether a plugin gets the last mouse event and which it | 6690 // In order to tell whether a plugin gets the last mouse event and which it |
| 6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6691 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6692 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6675 // |pepper_last_mouse_event_target_|. | 6693 // |pepper_last_mouse_event_target_|. |
| 6676 pepper_last_mouse_event_target_ = nullptr; | 6694 pepper_last_mouse_event_target_ = nullptr; |
| 6677 #endif | 6695 #endif |
| 6678 } | 6696 } |
| 6679 | 6697 |
| 6680 } // namespace content | 6698 } // namespace content |
| OLD | NEW |