| 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/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 render_view_->webview()->settings()->setTextTrackTextShadow( | 1642 render_view_->webview()->settings()->setTextTrackTextShadow( |
| 1643 WebString::fromUTF8(params.text_track_text_shadow)); | 1643 WebString::fromUTF8(params.text_track_text_shadow)); |
| 1644 render_view_->webview()->settings()->setTextTrackTextSize( | 1644 render_view_->webview()->settings()->setTextTrackTextSize( |
| 1645 WebString::fromUTF8(params.text_track_text_size)); | 1645 WebString::fromUTF8(params.text_track_text_size)); |
| 1646 } | 1646 } |
| 1647 | 1647 |
| 1648 void RenderFrameImpl::OnPostMessageEvent( | 1648 void RenderFrameImpl::OnPostMessageEvent( |
| 1649 const FrameMsg_PostMessage_Params& params) { | 1649 const FrameMsg_PostMessage_Params& params) { |
| 1650 // Find the source frame if it exists. | 1650 // Find the source frame if it exists. |
| 1651 WebFrame* source_frame = NULL; | 1651 WebFrame* source_frame = NULL; |
| 1652 if (params.source_view_routing_id != MSG_ROUTING_NONE) { | 1652 if (params.source_routing_id != MSG_ROUTING_NONE) { |
| 1653 // Support a legacy postMessage path for specifying a source RenderView; | |
| 1654 // this is currently used when sending messages to Android WebView. | |
| 1655 // TODO(alexmos): This path can be removed once crbug.com/473258 is fixed. | |
| 1656 RenderViewImpl* source_view = | |
| 1657 RenderViewImpl::FromRoutingID(params.source_view_routing_id); | |
| 1658 if (source_view) | |
| 1659 source_frame = source_view->webview()->mainFrame(); | |
| 1660 } else if (params.source_routing_id != MSG_ROUTING_NONE) { | |
| 1661 RenderFrameProxy* source_proxy = | 1653 RenderFrameProxy* source_proxy = |
| 1662 RenderFrameProxy::FromRoutingID(params.source_routing_id); | 1654 RenderFrameProxy::FromRoutingID(params.source_routing_id); |
| 1663 if (source_proxy) { | 1655 if (source_proxy) { |
| 1664 // Currently, navigating a top-level frame cross-process does not swap | 1656 // Currently, navigating a top-level frame cross-process does not swap |
| 1665 // the WebLocalFrame for a WebRemoteFrame in the frame tree, and the | 1657 // the WebLocalFrame for a WebRemoteFrame in the frame tree, and the |
| 1666 // WebRemoteFrame will not have an associated blink::Frame. If this is | 1658 // WebRemoteFrame will not have an associated blink::Frame. If this is |
| 1667 // the case for |source_proxy|, use the corresponding (swapped-out) | 1659 // the case for |source_proxy|, use the corresponding (swapped-out) |
| 1668 // WebLocalFrame instead, so that event.source for this message can be | 1660 // WebLocalFrame instead, so that event.source for this message can be |
| 1669 // set and used properly. | 1661 // set and used properly. |
| 1670 if (source_proxy->IsMainFrameDetachedFromTree()) | 1662 if (source_proxy->IsMainFrameDetachedFromTree()) |
| (...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5073 void RenderFrameImpl::RegisterMojoServices() { | 5065 void RenderFrameImpl::RegisterMojoServices() { |
| 5074 // Only main frame have ImageDownloader service. | 5066 // Only main frame have ImageDownloader service. |
| 5075 if (!frame_->parent()) { | 5067 if (!frame_->parent()) { |
| 5076 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( | 5068 GetServiceRegistry()->AddService<image_downloader::ImageDownloader>( |
| 5077 base::Bind(&ImageDownloaderImpl::CreateMojoService, | 5069 base::Bind(&ImageDownloaderImpl::CreateMojoService, |
| 5078 base::Unretained(this))); | 5070 base::Unretained(this))); |
| 5079 } | 5071 } |
| 5080 } | 5072 } |
| 5081 | 5073 |
| 5082 } // namespace content | 5074 } // namespace content |
| OLD | NEW |