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

Side by Side Diff: headless/app/shell_navigation_request.cc

Issue 2687083002: Headless: make URLRequestDispatcher aware of navigations (Closed)
Patch Set: Address nits Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 #include "headless/app/shell_navigation_request.h"
6
7 #include "headless/app/headless_shell.h"
8
9 namespace headless {
10
11 ShellNavigationRequest::ShellNavigationRequest(
12 base::WeakPtr<HeadlessShell> headless_shell,
13 const page::NavigationRequestedParams& params)
14 : headless_shell_(headless_shell),
15 navigation_id_(params.GetNavigationId()) {}
16
17 ShellNavigationRequest::~ShellNavigationRequest() {}
18
19 void ShellNavigationRequest::StartProcessing(base::Closure done_callback) {
20 if (!headless_shell_)
21 return;
22
23 // Allow the navigation to proceed.
24 headless_shell_->devtools_client()
25 ->GetPage()
26 ->GetExperimental()
27 ->ProcessNavigation(
28 headless::page::ProcessNavigationParams::Builder()
29 .SetNavigationId(navigation_id_)
30 .SetResponse(headless::page::NavigationResponse::PROCEED)
31 .Build(),
32 base::Bind(&ShellNavigationRequest::ProcessNavigationResult,
33 done_callback));
34 }
35
36 // static
37 void ShellNavigationRequest::ProcessNavigationResult(
38 base::Closure done_callback,
39 std::unique_ptr<page::ProcessNavigationResult>) {
40 done_callback.Run();
41 }
42
43 } // namespace headless
OLDNEW
« no previous file with comments | « headless/app/shell_navigation_request.h ('k') | headless/public/util/deterministic_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698