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

Side by Side Diff: headless/lib/browser/headless_web_contents_impl.cc

Issue 2808653002: make headless lib complie when enable_basic_printing is set to false (Closed)
Patch Set: minor fix Created 3 years, 8 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 | « headless/lib/browser/headless_devtools_manager_delegate.cc ('k') | headless/lib/renderer/DEPS » ('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 "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 13 matching lines...) Expand all
24 #include "content/public/browser/render_view_host.h" 24 #include "content/public/browser/render_view_host.h"
25 #include "content/public/browser/render_widget_host.h" 25 #include "content/public/browser/render_widget_host.h"
26 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
27 #include "content/public/browser/web_contents_delegate.h" 27 #include "content/public/browser/web_contents_delegate.h"
28 #include "content/public/common/bindings_policy.h" 28 #include "content/public/common/bindings_policy.h"
29 #include "content/public/common/origin_util.h" 29 #include "content/public/common/origin_util.h"
30 #include "headless/lib/browser/headless_browser_context_impl.h" 30 #include "headless/lib/browser/headless_browser_context_impl.h"
31 #include "headless/lib/browser/headless_browser_impl.h" 31 #include "headless/lib/browser/headless_browser_impl.h"
32 #include "headless/lib/browser/headless_browser_main_parts.h" 32 #include "headless/lib/browser/headless_browser_main_parts.h"
33 #include "headless/lib/browser/headless_devtools_client_impl.h" 33 #include "headless/lib/browser/headless_devtools_client_impl.h"
34 #include "printing/features/features.h"
35 #include "services/service_manager/public/cpp/interface_registry.h"
36
37 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
34 #include "headless/lib/browser/headless_print_manager.h" 38 #include "headless/lib/browser/headless_print_manager.h"
35 #include "services/service_manager/public/cpp/interface_registry.h" 39 #endif
36 40
37 namespace headless { 41 namespace headless {
38 42
39 // static 43 // static
40 HeadlessWebContentsImpl* HeadlessWebContentsImpl::From( 44 HeadlessWebContentsImpl* HeadlessWebContentsImpl::From(
41 HeadlessWebContents* web_contents) { 45 HeadlessWebContents* web_contents) {
42 // This downcast is safe because there is only one implementation of 46 // This downcast is safe because there is only one implementation of
43 // HeadlessWebContents. 47 // HeadlessWebContents.
44 return static_cast<HeadlessWebContentsImpl*>(web_contents); 48 return static_cast<HeadlessWebContentsImpl*>(web_contents);
45 } 49 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 HeadlessWebContentsImpl::HeadlessWebContentsImpl( 171 HeadlessWebContentsImpl::HeadlessWebContentsImpl(
168 content::WebContents* web_contents, 172 content::WebContents* web_contents,
169 HeadlessBrowserContextImpl* browser_context) 173 HeadlessBrowserContextImpl* browser_context)
170 : content::WebContentsObserver(web_contents), 174 : content::WebContentsObserver(web_contents),
171 web_contents_delegate_( 175 web_contents_delegate_(
172 new HeadlessWebContentsImpl::Delegate(browser_context)), 176 new HeadlessWebContentsImpl::Delegate(browser_context)),
173 web_contents_(web_contents), 177 web_contents_(web_contents),
174 agent_host_(content::DevToolsAgentHost::GetOrCreateFor(web_contents)), 178 agent_host_(content::DevToolsAgentHost::GetOrCreateFor(web_contents)),
175 browser_context_(browser_context), 179 browser_context_(browser_context),
176 render_process_host_(web_contents->GetRenderProcessHost()) { 180 render_process_host_(web_contents->GetRenderProcessHost()) {
181 #if BUILDFLAG(ENABLE_BASIC_PRINTING)
177 printing::HeadlessPrintManager::CreateForWebContents(web_contents); 182 printing::HeadlessPrintManager::CreateForWebContents(web_contents);
183 #endif
178 web_contents_->SetDelegate(web_contents_delegate_.get()); 184 web_contents_->SetDelegate(web_contents_delegate_.get());
179 render_process_host_->AddObserver(this); 185 render_process_host_->AddObserver(this);
180 } 186 }
181 187
182 HeadlessWebContentsImpl::~HeadlessWebContentsImpl() { 188 HeadlessWebContentsImpl::~HeadlessWebContentsImpl() {
183 if (render_process_host_) 189 if (render_process_host_)
184 render_process_host_->RemoveObserver(this); 190 render_process_host_->RemoveObserver(this);
185 } 191 }
186 192
187 void HeadlessWebContentsImpl::RenderFrameCreated( 193 void HeadlessWebContentsImpl::RenderFrameCreated(
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 HeadlessWebContents::Builder::MojoService::MojoService() {} 328 HeadlessWebContents::Builder::MojoService::MojoService() {}
323 329
324 HeadlessWebContents::Builder::MojoService::MojoService( 330 HeadlessWebContents::Builder::MojoService::MojoService(
325 const std::string& service_name, 331 const std::string& service_name,
326 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) 332 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory)
327 : service_name(service_name), service_factory(service_factory) {} 333 : service_name(service_name), service_factory(service_factory) {}
328 334
329 HeadlessWebContents::Builder::MojoService::~MojoService() {} 335 HeadlessWebContents::Builder::MojoService::~MojoService() {}
330 336
331 } // namespace headless 337 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_devtools_manager_delegate.cc ('k') | headless/lib/renderer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698