| 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 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 | 1675 |
| 1676 int RenderFrameImpl::GetRoutingID() { | 1676 int RenderFrameImpl::GetRoutingID() { |
| 1677 return routing_id_; | 1677 return routing_id_; |
| 1678 } | 1678 } |
| 1679 | 1679 |
| 1680 blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { | 1680 blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { |
| 1681 DCHECK(frame_); | 1681 DCHECK(frame_); |
| 1682 return frame_; | 1682 return frame_; |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 WebElement RenderFrameImpl::GetFocusedElement() const { |
| 1686 WebDocument doc = frame_->document(); |
| 1687 if (!doc.isNull()) |
| 1688 return doc.focusedElement(); |
| 1689 |
| 1690 return WebElement(); |
| 1691 } |
| 1692 |
| 1685 WebPreferences& RenderFrameImpl::GetWebkitPreferences() { | 1693 WebPreferences& RenderFrameImpl::GetWebkitPreferences() { |
| 1686 return render_view_->GetWebkitPreferences(); | 1694 return render_view_->GetWebkitPreferences(); |
| 1687 } | 1695 } |
| 1688 | 1696 |
| 1689 int RenderFrameImpl::ShowContextMenu(ContextMenuClient* client, | 1697 int RenderFrameImpl::ShowContextMenu(ContextMenuClient* client, |
| 1690 const ContextMenuParams& params) { | 1698 const ContextMenuParams& params) { |
| 1691 DCHECK(client); // A null client means "internal" when we issue callbacks. | 1699 DCHECK(client); // A null client means "internal" when we issue callbacks. |
| 1692 ContextMenuParams our_params(params); | 1700 ContextMenuParams our_params(params); |
| 1693 our_params.custom_context.request_id = pending_context_menus_.Add(client); | 1701 our_params.custom_context.request_id = pending_context_menus_.Add(client); |
| 1694 Send(new FrameHostMsg_ContextMenu(routing_id_, our_params)); | 1702 Send(new FrameHostMsg_ContextMenu(routing_id_, our_params)); |
| (...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3822 | 3830 |
| 3823 render_view_->last_page_id_sent_to_browser_ = | 3831 render_view_->last_page_id_sent_to_browser_ = |
| 3824 std::max(render_view_->last_page_id_sent_to_browser_, | 3832 std::max(render_view_->last_page_id_sent_to_browser_, |
| 3825 render_view_->page_id_); | 3833 render_view_->page_id_); |
| 3826 | 3834 |
| 3827 // If we end up reusing this WebRequest (for example, due to a #ref click), | 3835 // If we end up reusing this WebRequest (for example, due to a #ref click), |
| 3828 // we don't want the transition type to persist. Just clear it. | 3836 // we don't want the transition type to persist. Just clear it. |
| 3829 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); | 3837 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); |
| 3830 } | 3838 } |
| 3831 | 3839 |
| 3832 WebElement RenderFrameImpl::GetFocusedElement() { | |
| 3833 WebDocument doc = frame_->document(); | |
| 3834 if (!doc.isNull()) | |
| 3835 return doc.focusedElement(); | |
| 3836 | |
| 3837 return WebElement(); | |
| 3838 } | |
| 3839 | |
| 3840 void RenderFrameImpl::didStartLoading(bool to_different_document) { | 3840 void RenderFrameImpl::didStartLoading(bool to_different_document) { |
| 3841 TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading", | 3841 TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading", |
| 3842 "id", routing_id_); | 3842 "id", routing_id_); |
| 3843 render_view_->FrameDidStartLoading(frame_); | 3843 render_view_->FrameDidStartLoading(frame_); |
| 3844 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); | 3844 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); |
| 3845 } | 3845 } |
| 3846 | 3846 |
| 3847 void RenderFrameImpl::didStopLoading() { | 3847 void RenderFrameImpl::didStopLoading() { |
| 3848 TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading", | 3848 TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading", |
| 3849 "id", routing_id_); | 3849 "id", routing_id_); |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4456 | 4456 |
| 4457 #if defined(ENABLE_BROWSER_CDMS) | 4457 #if defined(ENABLE_BROWSER_CDMS) |
| 4458 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4458 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 4459 if (!cdm_manager_) | 4459 if (!cdm_manager_) |
| 4460 cdm_manager_ = new RendererCdmManager(this); | 4460 cdm_manager_ = new RendererCdmManager(this); |
| 4461 return cdm_manager_; | 4461 return cdm_manager_; |
| 4462 } | 4462 } |
| 4463 #endif // defined(ENABLE_BROWSER_CDMS) | 4463 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4464 | 4464 |
| 4465 } // namespace content | 4465 } // namespace content |
| OLD | NEW |