| 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 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 | 1671 |
| 1672 int RenderFrameImpl::GetRoutingID() { | 1672 int RenderFrameImpl::GetRoutingID() { |
| 1673 return routing_id_; | 1673 return routing_id_; |
| 1674 } | 1674 } |
| 1675 | 1675 |
| 1676 blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { | 1676 blink::WebLocalFrame* RenderFrameImpl::GetWebFrame() { |
| 1677 DCHECK(frame_); | 1677 DCHECK(frame_); |
| 1678 return frame_; | 1678 return frame_; |
| 1679 } | 1679 } |
| 1680 | 1680 |
| 1681 WebElement RenderFrameImpl::GetFocusedElement() const { |
| 1682 WebDocument doc = frame_->document(); |
| 1683 if (!doc.isNull()) |
| 1684 return doc.focusedElement(); |
| 1685 |
| 1686 return WebElement(); |
| 1687 } |
| 1688 |
| 1681 WebPreferences& RenderFrameImpl::GetWebkitPreferences() { | 1689 WebPreferences& RenderFrameImpl::GetWebkitPreferences() { |
| 1682 return render_view_->GetWebkitPreferences(); | 1690 return render_view_->GetWebkitPreferences(); |
| 1683 } | 1691 } |
| 1684 | 1692 |
| 1685 int RenderFrameImpl::ShowContextMenu(ContextMenuClient* client, | 1693 int RenderFrameImpl::ShowContextMenu(ContextMenuClient* client, |
| 1686 const ContextMenuParams& params) { | 1694 const ContextMenuParams& params) { |
| 1687 DCHECK(client); // A null client means "internal" when we issue callbacks. | 1695 DCHECK(client); // A null client means "internal" when we issue callbacks. |
| 1688 ContextMenuParams our_params(params); | 1696 ContextMenuParams our_params(params); |
| 1689 our_params.custom_context.request_id = pending_context_menus_.Add(client); | 1697 our_params.custom_context.request_id = pending_context_menus_.Add(client); |
| 1690 Send(new FrameHostMsg_ContextMenu(routing_id_, our_params)); | 1698 Send(new FrameHostMsg_ContextMenu(routing_id_, our_params)); |
| (...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3814 | 3822 |
| 3815 render_view_->last_page_id_sent_to_browser_ = | 3823 render_view_->last_page_id_sent_to_browser_ = |
| 3816 std::max(render_view_->last_page_id_sent_to_browser_, | 3824 std::max(render_view_->last_page_id_sent_to_browser_, |
| 3817 render_view_->page_id_); | 3825 render_view_->page_id_); |
| 3818 | 3826 |
| 3819 // If we end up reusing this WebRequest (for example, due to a #ref click), | 3827 // If we end up reusing this WebRequest (for example, due to a #ref click), |
| 3820 // we don't want the transition type to persist. Just clear it. | 3828 // we don't want the transition type to persist. Just clear it. |
| 3821 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); | 3829 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); |
| 3822 } | 3830 } |
| 3823 | 3831 |
| 3824 WebElement RenderFrameImpl::GetFocusedElement() { | |
| 3825 WebDocument doc = frame_->document(); | |
| 3826 if (!doc.isNull()) | |
| 3827 return doc.focusedElement(); | |
| 3828 | |
| 3829 return WebElement(); | |
| 3830 } | |
| 3831 | |
| 3832 void RenderFrameImpl::didStartLoading(bool to_different_document) { | 3832 void RenderFrameImpl::didStartLoading(bool to_different_document) { |
| 3833 TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading", | 3833 TRACE_EVENT1("navigation", "RenderFrameImpl::didStartLoading", |
| 3834 "id", routing_id_); | 3834 "id", routing_id_); |
| 3835 render_view_->FrameDidStartLoading(frame_); | 3835 render_view_->FrameDidStartLoading(frame_); |
| 3836 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); | 3836 Send(new FrameHostMsg_DidStartLoading(routing_id_, to_different_document)); |
| 3837 } | 3837 } |
| 3838 | 3838 |
| 3839 void RenderFrameImpl::didStopLoading() { | 3839 void RenderFrameImpl::didStopLoading() { |
| 3840 TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading", | 3840 TRACE_EVENT1("navigation", "RenderFrameImpl::didStopLoading", |
| 3841 "id", routing_id_); | 3841 "id", routing_id_); |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4448 | 4448 |
| 4449 #if defined(ENABLE_BROWSER_CDMS) | 4449 #if defined(ENABLE_BROWSER_CDMS) |
| 4450 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4450 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 4451 if (!cdm_manager_) | 4451 if (!cdm_manager_) |
| 4452 cdm_manager_ = new RendererCdmManager(this); | 4452 cdm_manager_ = new RendererCdmManager(this); |
| 4453 return cdm_manager_; | 4453 return cdm_manager_; |
| 4454 } | 4454 } |
| 4455 #endif // defined(ENABLE_BROWSER_CDMS) | 4455 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4456 | 4456 |
| 4457 } // namespace content | 4457 } // namespace content |
| OLD | NEW |