OLD | NEW |
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 "headless/lib/browser/headless_web_contents_impl.h" | 5 #include "headless/lib/browser/headless_web_contents_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 HeadlessWebContents::Observer* observer_; // Not owned. | 68 HeadlessWebContents::Observer* observer_; // Not owned. |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverAdapter); | 70 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverAdapter); |
71 }; | 71 }; |
72 | 72 |
73 class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate { | 73 class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate { |
74 public: | 74 public: |
75 explicit Delegate(HeadlessBrowserContextImpl* browser_context) | 75 explicit Delegate(HeadlessBrowserContextImpl* browser_context) |
76 : browser_context_(browser_context) {} | 76 : browser_context_(browser_context) {} |
77 | 77 |
78 void WebContentsCreated( | 78 void WebContentsCreated(content::WebContents* source_contents, |
79 content::WebContents* source_contents, | 79 int opener_render_process_id, |
80 int opener_render_process_id, | 80 int opener_render_frame_id, |
81 int opener_render_frame_id, | 81 const std::string& frame_name, |
82 const std::string& frame_name, | 82 const GURL& target_url, |
83 const GURL& target_url, | 83 content::WebContents* new_contents) override { |
84 content::WebContents* new_contents, | |
85 const base::Optional<content::WebContents::CreateParams>& create_params) | |
86 override { | |
87 std::unique_ptr<HeadlessWebContentsImpl> web_contents = | 84 std::unique_ptr<HeadlessWebContentsImpl> web_contents = |
88 HeadlessWebContentsImpl::CreateFromWebContents(new_contents, | 85 HeadlessWebContentsImpl::CreateFromWebContents(new_contents, |
89 browser_context_); | 86 browser_context_); |
90 | 87 |
91 DCHECK(new_contents->GetBrowserContext() == browser_context_); | 88 DCHECK(new_contents->GetBrowserContext() == browser_context_); |
92 | 89 |
93 browser_context_->RegisterWebContents(std::move(web_contents)); | 90 browser_context_->RegisterWebContents(std::move(web_contents)); |
94 } | 91 } |
95 | 92 |
96 #if !defined(CHROME_MULTIPLE_DLL_CHILD) | 93 #if !defined(CHROME_MULTIPLE_DLL_CHILD) |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 HeadlessWebContents::Builder::MojoService::MojoService() {} | 406 HeadlessWebContents::Builder::MojoService::MojoService() {} |
410 | 407 |
411 HeadlessWebContents::Builder::MojoService::MojoService( | 408 HeadlessWebContents::Builder::MojoService::MojoService( |
412 const std::string& service_name, | 409 const std::string& service_name, |
413 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) | 410 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) |
414 : service_name(service_name), service_factory(service_factory) {} | 411 : service_name(service_name), service_factory(service_factory) {} |
415 | 412 |
416 HeadlessWebContents::Builder::MojoService::~MojoService() {} | 413 HeadlessWebContents::Builder::MojoService::~MojoService() {} |
417 | 414 |
418 } // namespace headless | 415 } // namespace headless |
OLD | NEW |