Roll src/third_party/WebKit be75a8c:e354095 (svn 202106:202107)
[chromium-blink-merge.git] / components / web_view / pending_web_view_load.cc
blob81fc34118c90a2ff09d04835cf81adada307c573
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/web_view/pending_web_view_load.h"
7 #include "base/bind.h"
8 #include "base/callback.h"
9 #include "components/web_view/frame_connection.h"
10 #include "components/web_view/web_view_impl.h"
12 namespace web_view {
14 PendingWebViewLoad::PendingWebViewLoad(WebViewImpl* web_view)
15 : web_view_(web_view), is_content_handler_id_valid_(false) {}
17 PendingWebViewLoad::~PendingWebViewLoad() {}
19 void PendingWebViewLoad::Init(mojo::URLRequestPtr request) {
20 DCHECK(!frame_connection_);
21 frame_connection_.reset(new FrameConnection);
22 frame_connection_->Init(web_view_->app_, request.Pass(),
23 base::Bind(&PendingWebViewLoad::OnGotContentHandlerID,
24 base::Unretained(this)));
27 void PendingWebViewLoad::OnGotContentHandlerID() {
28 is_content_handler_id_valid_ = true;
29 if (web_view_->content_)
30 web_view_->OnLoad();
31 // The else case is handled by WebViewImpl when it gets the View (|content_|).
34 } // namespace web_view