| 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 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 848 |
| 849 void RenderFrameImpl::CancelContextMenu(int request_id) { | 849 void RenderFrameImpl::CancelContextMenu(int request_id) { |
| 850 DCHECK(pending_context_menus_.Lookup(request_id)); | 850 DCHECK(pending_context_menus_.Lookup(request_id)); |
| 851 pending_context_menus_.Remove(request_id); | 851 pending_context_menus_.Remove(request_id); |
| 852 } | 852 } |
| 853 | 853 |
| 854 blink::WebPlugin* RenderFrameImpl::CreatePlugin( | 854 blink::WebPlugin* RenderFrameImpl::CreatePlugin( |
| 855 blink::WebFrame* frame, | 855 blink::WebFrame* frame, |
| 856 const WebPluginInfo& info, | 856 const WebPluginInfo& info, |
| 857 const blink::WebPluginParams& params) { | 857 const blink::WebPluginParams& params) { |
| 858 // TODO(creis): |frame| is different from |frame_| here. This seems wrong. | 858 DCHECK_EQ(frame_, frame); |
| 859 #if defined(ENABLE_PLUGINS) | 859 #if defined(ENABLE_PLUGINS) |
| 860 bool pepper_plugin_was_registered = false; | 860 bool pepper_plugin_was_registered = false; |
| 861 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( | 861 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( |
| 862 this, info, &pepper_plugin_was_registered)); | 862 this, info, &pepper_plugin_was_registered)); |
| 863 if (pepper_plugin_was_registered) { | 863 if (pepper_plugin_was_registered) { |
| 864 if (pepper_module.get()) { | 864 if (pepper_module.get()) { |
| 865 return new PepperWebPluginImpl(pepper_module.get(), params, this); | 865 return new PepperWebPluginImpl(pepper_module.get(), params, this); |
| 866 } | 866 } |
| 867 } | 867 } |
| 868 #if defined(OS_CHROMEOS) | 868 #if defined(OS_CHROMEOS) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 888 void RenderFrameImpl::OnChildFrameProcessGone() { | 888 void RenderFrameImpl::OnChildFrameProcessGone() { |
| 889 if (compositing_helper_) | 889 if (compositing_helper_) |
| 890 compositing_helper_->ChildFrameGone(); | 890 compositing_helper_->ChildFrameGone(); |
| 891 } | 891 } |
| 892 | 892 |
| 893 // blink::WebFrameClient implementation ---------------------------------------- | 893 // blink::WebFrameClient implementation ---------------------------------------- |
| 894 | 894 |
| 895 blink::WebPlugin* RenderFrameImpl::createPlugin( | 895 blink::WebPlugin* RenderFrameImpl::createPlugin( |
| 896 blink::WebFrame* frame, | 896 blink::WebFrame* frame, |
| 897 const blink::WebPluginParams& params) { | 897 const blink::WebPluginParams& params) { |
| 898 // TODO(creis): |frame| is different from |frame_| here. This seems wrong. | 898 DCHECK_EQ(frame_, frame); |
| 899 blink::WebPlugin* plugin = NULL; | 899 blink::WebPlugin* plugin = NULL; |
| 900 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 900 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
| 901 this, frame, params, &plugin)) { | 901 this, frame, params, &plugin)) { |
| 902 return plugin; | 902 return plugin; |
| 903 } | 903 } |
| 904 | 904 |
| 905 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { | 905 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { |
| 906 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 906 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( |
| 907 render_view_.get(), frame); | 907 render_view_.get(), frame); |
| 908 } | 908 } |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 should_replace_current_entry = data_source->replacesCurrentHistoryItem(); | 1673 should_replace_current_entry = data_source->replacesCurrentHistoryItem(); |
| 1674 } else { | 1674 } else { |
| 1675 // If the navigation is browser-initiated, the NavigationState contains the | 1675 // If the navigation is browser-initiated, the NavigationState contains the |
| 1676 // correct value instead of the WebDataSource. | 1676 // correct value instead of the WebDataSource. |
| 1677 // | 1677 // |
| 1678 // TODO(davidben): Avoid this awkward duplication of state. See comment on | 1678 // TODO(davidben): Avoid this awkward duplication of state. See comment on |
| 1679 // NavigationState::should_replace_current_entry(). | 1679 // NavigationState::should_replace_current_entry(). |
| 1680 should_replace_current_entry = | 1680 should_replace_current_entry = |
| 1681 navigation_state->should_replace_current_entry(); | 1681 navigation_state->should_replace_current_entry(); |
| 1682 } | 1682 } |
| 1683 // TODO(creis): Remove the second routing ID from the request, now that we | |
| 1684 // use routing IDs instead of frame IDs. (This is a viral change, so I'm | |
| 1685 // splitting it into multiple CLs.) | |
| 1686 int parent_routing_id = frame->parent() ? | 1683 int parent_routing_id = frame->parent() ? |
| 1687 FromWebFrame(frame->parent())->GetRoutingID() : -1; | 1684 FromWebFrame(frame->parent())->GetRoutingID() : -1; |
| 1688 request.setExtraData( | 1685 request.setExtraData( |
| 1689 new RequestExtraData(render_view_->visibilityState(), | 1686 new RequestExtraData(render_view_->visibilityState(), |
| 1690 custom_user_agent, | 1687 custom_user_agent, |
| 1691 was_after_preconnect_request, | 1688 was_after_preconnect_request, |
| 1692 routing_id_, | 1689 routing_id_, |
| 1693 (frame == top_frame), | 1690 (frame == top_frame), |
| 1694 routing_id_, | |
| 1695 GURL(frame->document().securityOrigin().toString()), | 1691 GURL(frame->document().securityOrigin().toString()), |
| 1696 frame->parent() == top_frame, | 1692 frame->parent() == top_frame, |
| 1697 parent_routing_id, | 1693 parent_routing_id, |
| 1698 navigation_state->allow_download(), | 1694 navigation_state->allow_download(), |
| 1699 transition_type, | 1695 transition_type, |
| 1700 should_replace_current_entry, | 1696 should_replace_current_entry, |
| 1701 navigation_state->transferred_request_child_id(), | 1697 navigation_state->transferred_request_child_id(), |
| 1702 navigation_state->transferred_request_request_id())); | 1698 navigation_state->transferred_request_request_id())); |
| 1703 | 1699 |
| 1704 DocumentState* top_document_state = | 1700 DocumentState* top_document_state = |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2275 | 2271 |
| 2276 void RenderFrameImpl::didStartLoading() { | 2272 void RenderFrameImpl::didStartLoading() { |
| 2277 Send(new FrameHostMsg_DidStartLoading(routing_id_)); | 2273 Send(new FrameHostMsg_DidStartLoading(routing_id_)); |
| 2278 } | 2274 } |
| 2279 | 2275 |
| 2280 void RenderFrameImpl::didStopLoading() { | 2276 void RenderFrameImpl::didStopLoading() { |
| 2281 Send(new FrameHostMsg_DidStopLoading(routing_id_)); | 2277 Send(new FrameHostMsg_DidStopLoading(routing_id_)); |
| 2282 } | 2278 } |
| 2283 | 2279 |
| 2284 } // namespace content | 2280 } // namespace content |
| OLD | NEW |