Clear children from a subframe when it does a cross process navigation.
commit53d5cbfc41ced6004ce4a907a3e224fefaafad52
authornick <nick@chromium.org>
Thu, 23 Apr 2015 22:50:14 +0000 (23 15:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 23 Apr 2015 22:50:26 +0000 (23 22:50 +0000)
tree9d508c5be5de8e5115213f6674c51a72f4148417
parenta5de7e4efa6774cd8b24da3152e88077b8b63b82
Clear children from a subframe when it does a cross process navigation.

Previously we'd had this behavior just for main frames (via
AttachToFrameTree) but we should do it for child frames too.

Eliminate AttachToFrameTree altogether. Move tracking of the focused
frame to hinge on removal of a frame from the tree. Note that this
means that frame focus is retained on cross-process navigation,
which matches the behavior of an in-process navigation, and also
matches the behavior we had [on cross-process RVH nav] before
focus was tracked per-frame.

Add a test that exercises the interaction of focus and detach.

Bonus: Add a covariant getter for WebContentsImpl::GetFocusedFrame()

BUG=476628,444563,425248

Review URL: https://codereview.chromium.org/1104723002

Cr-Commit-Position: refs/heads/master@{#326681}
content/browser/frame_host/frame_tree.cc
content/browser/frame_host/frame_tree.h
content/browser/frame_host/interstitial_page_impl.cc
content/browser/frame_host/render_frame_host_impl_browsertest.cc
content/browser/frame_host/render_frame_host_manager.cc
content/browser/renderer_host/render_view_host_impl.cc
content/browser/renderer_host/render_view_host_impl.h
content/browser/site_per_process_browsertest.cc
content/browser/web_contents/web_contents_impl.cc
content/browser/web_contents/web_contents_impl.h
content/test/data/render_frame_host/focus.html