diff options
author | sky <sky@chromium.org> | 2015-08-14 12:49:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-14 19:49:41 +0000 |
commit | c2b62129ee841ff23c4ca242b009db20a73e9d97 (patch) | |
tree | 59045decb2c8b9cc427f03c0a96bde631f4a1d9f /components/html_viewer/html_frame_tree_manager.cc | |
parent | 18aef9e80c78e646dac22a19dc88c700589058e0 (diff) | |
download | chromium_src-c2b62129ee841ff23c4ca242b009db20a73e9d97.zip chromium_src-c2b62129ee841ff23c4ca242b009db20a73e9d97.tar.gz chromium_src-c2b62129ee841ff23c4ca242b009db20a73e9d97.tar.bz2 |
Converts layout test harness to OOPIFs
I'm going to make OOPIF the default soon. This makes the layout test
running code work with OOPIFs (only).
BUG=479172,490221
TEST=none
R=fsamuel@chromium.org
Review URL: https://codereview.chromium.org/1292183003
Cr-Commit-Position: refs/heads/master@{#343460}
Diffstat (limited to 'components/html_viewer/html_frame_tree_manager.cc')
-rw-r--r-- | components/html_viewer/html_frame_tree_manager.cc | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/components/html_viewer/html_frame_tree_manager.cc b/components/html_viewer/html_frame_tree_manager.cc index c529bda..2066f89 100644 --- a/components/html_viewer/html_frame_tree_manager.cc +++ b/components/html_viewer/html_frame_tree_manager.cc @@ -89,15 +89,13 @@ HTMLFrame* HTMLFrameTreeManager::CreateFrameAndAttachToTree( const mandoline::FrameDataPtr& data = frame_data[frame_data_index]; if (existing_frame) { CHECK(!existing_frame->IsLocal()); - existing_frame->set_delegate(delegate); - existing_frame->SwapToLocal(view, data->client_properties); + existing_frame->SwapToLocal(delegate, view, data->client_properties); } else { HTMLFrame* parent = frame_tree->root_->FindFrame(data->parent_id); CHECK(parent); - HTMLFrame::CreateParams params(frame_tree, parent, view->id()); - HTMLFrame* frame = new HTMLFrame(params); - frame->set_delegate(delegate); - frame->Init(view, data->client_properties); + HTMLFrame::CreateParams params(frame_tree, parent, view->id(), view, + data->client_properties, delegate); + delegate->CreateHTMLFrame(¶ms); } } @@ -167,18 +165,17 @@ HTMLFrame* HTMLFrameTreeManager::BuildFrameTree( } HTMLFrame::CreateParams params(this, !parents.empty() ? parents.back() : nullptr, - frame_data[i]->frame_id); - HTMLFrame* frame = new HTMLFrame(params); + frame_data[i]->frame_id, local_view, + frame_data[i]->client_properties, nullptr); + if (frame_data[i]->frame_id == local_frame_id) + params.delegate = delegate; + + HTMLFrame* frame = delegate->CreateHTMLFrame(¶ms); if (!last_frame) root = frame; else DCHECK(frame->parent()); last_frame = frame; - - if (frame_data[i]->frame_id == local_frame_id) - frame->set_delegate(delegate); - - frame->Init(local_view, frame_data[i]->client_properties); } return root; } @@ -235,10 +232,10 @@ void HTMLFrameTreeManager::ProcessOnFrameAdded( if (pending_remove_ids_.count(frame_data->frame_id)) return; - HTMLFrame::CreateParams params(this, parent, frame_data->frame_id); - // |parent| takes ownership of |frame|. - HTMLFrame* frame = new HTMLFrame(params); - frame->Init(nullptr, frame_data->client_properties); + HTMLFrame::CreateParams params(this, parent, frame_data->frame_id, nullptr, + frame_data->client_properties, nullptr); + // |parent| takes ownership of created HTMLFrame. + source->GetLocalRoot()->delegate_->CreateHTMLFrame(¶ms); } void HTMLFrameTreeManager::ProcessOnFrameRemoved(HTMLFrame* source, |