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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 925 void RenderFrameHostImpl::OnDidDropNavigation() { | 925 void RenderFrameHostImpl::OnDidDropNavigation() { |
| 926 // At the end of Navigate(), the FrameTreeNode's DidStartLoading is called to | 926 // At the end of Navigate(), the FrameTreeNode's DidStartLoading is called to |
| 927 // force the spinner to start, even if the renderer didn't yet begin the load. | 927 // force the spinner to start, even if the renderer didn't yet begin the load. |
| 928 // If it turns out that the renderer dropped the navigation, the spinner needs | 928 // If it turns out that the renderer dropped the navigation, the spinner needs |
| 929 // to be turned off. | 929 // to be turned off. |
| 930 frame_tree_node_->DidStopLoading(); | 930 frame_tree_node_->DidStopLoading(); |
| 931 navigation_handle_.reset(); | 931 navigation_handle_.reset(); |
| 932 } | 932 } |
| 933 | 933 |
| 934 RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() { | 934 RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() { |
| 935 if (render_widget_host_) | |
| 936 return render_widget_host_; | |
| 937 | |
| 938 // TODO(kenrb): When RenderViewHost no longer inherits RenderWidgetHost, | 935 // TODO(kenrb): When RenderViewHost no longer inherits RenderWidgetHost, |
| 939 // we can remove this fallback. Currently it is only used for the main | 936 // we can remove this fallback. Currently it is only used for the main |
| 940 // frame. | 937 // frame. |
| 941 if (!GetParent()) | 938 if (!GetParent()) |
| 942 return static_cast<RenderWidgetHostImpl*>(render_view_host_); | 939 return static_cast<RenderWidgetHostImpl*>(render_view_host_); |
| 943 | 940 |
| 941 if (render_widget_host_) | |
| 942 return render_widget_host_; | |
| 943 | |
| 944 return nullptr; | 944 return nullptr; |
| 945 } | 945 } |
| 946 | 946 |
| 947 RenderWidgetHostView* RenderFrameHostImpl::GetView() { | 947 RenderWidgetHostView* RenderFrameHostImpl::GetView() { |
| 948 RenderFrameHostImpl* frame = this; | 948 // TODO(dcheng): Similar to above, though the main RenderFrameHost now has a |
|
ncarter (slow)
2015/09/03 20:24:37
It's not clear what "similar to above" refers to i
dcheng
2015/09/03 21:29:24
Done.
| |
| 949 while (frame) { | 949 // RenderWidgetHost, a lot of the plumbing is still missing. Thus, for now, |
| 950 // the main frame always uses the RVH's view. https://crbug.com/526958 | |
| 951 for (RenderFrameHostImpl* frame = this; frame->GetParent(); | |
| 952 frame = static_cast<RenderFrameHostImpl*>(frame->GetParent())) { | |
| 950 if (frame->render_widget_host_) | 953 if (frame->render_widget_host_) |
| 951 return frame->render_widget_host_->GetView(); | 954 return frame->render_widget_host_->GetView(); |
| 952 frame = static_cast<RenderFrameHostImpl*>(frame->GetParent()); | |
| 953 } | 955 } |
| 954 | 956 |
| 955 return render_view_host_->GetView(); | 957 return render_view_host_->GetView(); |
| 956 } | 958 } |
| 957 | 959 |
| 958 int RenderFrameHostImpl::GetEnabledBindings() { | 960 int RenderFrameHostImpl::GetEnabledBindings() { |
| 959 return render_view_host_->GetEnabledBindings(); | 961 return render_view_host_->GetEnabledBindings(); |
| 960 } | 962 } |
| 961 | 963 |
| 962 void RenderFrameHostImpl::SetNavigationHandle( | 964 void RenderFrameHostImpl::SetNavigationHandle( |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2225 BrowserPluginInstanceIDToAXTreeID(value))); | 2227 BrowserPluginInstanceIDToAXTreeID(value))); |
| 2226 break; | 2228 break; |
| 2227 case AX_CONTENT_INT_ATTRIBUTE_LAST: | 2229 case AX_CONTENT_INT_ATTRIBUTE_LAST: |
| 2228 NOTREACHED(); | 2230 NOTREACHED(); |
| 2229 break; | 2231 break; |
| 2230 } | 2232 } |
| 2231 } | 2233 } |
| 2232 } | 2234 } |
| 2233 | 2235 |
| 2234 } // namespace content | 2236 } // namespace content |
| OLD | NEW |