Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1669)

Side by Side Diff: components/web_view/pending_web_view_load.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/web_view/frame_devtools_agent.cc ('k') | components/web_view/public/cpp/web_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "components/web_view/pending_web_view_load.h" 5 #include "components/web_view/pending_web_view_load.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "components/web_view/frame_connection.h" 11 #include "components/web_view/frame_connection.h"
12 #include "components/web_view/web_view_impl.h" 12 #include "components/web_view/web_view_impl.h"
13 13
14 namespace web_view { 14 namespace web_view {
15 15
16 PendingWebViewLoad::PendingWebViewLoad(WebViewImpl* web_view) 16 PendingWebViewLoad::PendingWebViewLoad(WebViewImpl* web_view)
17 : web_view_(web_view), is_content_handler_id_valid_(false) {} 17 : web_view_(web_view), is_content_handler_id_valid_(false) {}
18 18
19 PendingWebViewLoad::~PendingWebViewLoad() {} 19 PendingWebViewLoad::~PendingWebViewLoad() {}
20 20
21 void PendingWebViewLoad::Init(mojo::URLRequestPtr request) { 21 void PendingWebViewLoad::Init(mojo::URLRequestPtr request) {
22 DCHECK(!frame_connection_); 22 DCHECK(!frame_connection_);
23 pending_url_ = GURL(request->url.get()); 23 pending_url_ = GURL(request->url.get());
24 navigation_start_time_ = 24 navigation_start_time_ =
25 base::TimeTicks::FromInternalValue(request->originating_time_ticks); 25 base::TimeTicks::FromInternalValue(request->originating_time_ticks);
26 frame_connection_.reset(new FrameConnection); 26 frame_connection_.reset(new FrameConnection);
27 frame_connection_->Init(web_view_->app_, std::move(request), 27 frame_connection_->Init(web_view_->shell_, std::move(request),
28 base::Bind(&PendingWebViewLoad::OnGotContentHandlerID, 28 base::Bind(&PendingWebViewLoad::OnGotContentHandlerID,
29 base::Unretained(this))); 29 base::Unretained(this)));
30 } 30 }
31 31
32 void PendingWebViewLoad::OnGotContentHandlerID() { 32 void PendingWebViewLoad::OnGotContentHandlerID() {
33 is_content_handler_id_valid_ = true; 33 is_content_handler_id_valid_ = true;
34 if (web_view_->root_) 34 if (web_view_->root_)
35 web_view_->OnLoad(pending_url_); 35 web_view_->OnLoad(pending_url_);
36 // The else case is handled by WebViewImpl when it gets the Window (|root_|). 36 // The else case is handled by WebViewImpl when it gets the Window (|root_|).
37 } 37 }
38 38
39 } // namespace web_view 39 } // namespace web_view
OLDNEW
« no previous file with comments | « components/web_view/frame_devtools_agent.cc ('k') | components/web_view/public/cpp/web_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698