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

Side by Side Diff: headless/lib/headless_content_main_delegate.cc

Issue 2780433002: add print to pdf for headless (Closed)
Patch Set: improve comments as suggested 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
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/headless_content_main_delegate.h" 5 #include "headless/lib/headless_content_main_delegate.h"
6 6
7 #include <utility>
8
7 #include "base/base_switches.h" 9 #include "base/base_switches.h"
8 #include "base/command_line.h" 10 #include "base/command_line.h"
9 #include "base/environment.h" 11 #include "base/environment.h"
10 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
11 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
12 #include "base/path_service.h" 14 #include "base/path_service.h"
13 #include "base/run_loop.h" 15 #include "base/run_loop.h"
14 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
15 #include "base/trace_event/trace_event.h" 17 #include "base/trace_event/trace_event.h"
16 #include "components/crash/content/app/breakpad_linux.h" 18 #include "components/crash/content/app/breakpad_linux.h"
17 #include "content/public/browser/browser_main_runner.h" 19 #include "content/public/browser/browser_main_runner.h"
18 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
19 #include "headless/lib/browser/headless_browser_impl.h" 21 #include "headless/lib/browser/headless_browser_impl.h"
20 #include "headless/lib/browser/headless_content_browser_client.h" 22 #include "headless/lib/browser/headless_content_browser_client.h"
21 #include "headless/lib/headless_crash_reporter_client.h" 23 #include "headless/lib/headless_crash_reporter_client.h"
22 #include "headless/lib/headless_macros.h" 24 #include "headless/lib/headless_macros.h"
25 #include "headless/lib/renderer/headless_content_renderer_client.h"
23 #include "ui/base/resource/resource_bundle.h" 26 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/base/ui_base_switches.h" 27 #include "ui/base/ui_base_switches.h"
25 #include "ui/gfx/switches.h" 28 #include "ui/gfx/switches.h"
26 #include "ui/gl/gl_switches.h" 29 #include "ui/gl/gl_switches.h"
27 #include "ui/ozone/public/ozone_switches.h" 30 #include "ui/ozone/public/ozone_switches.h"
28 31
29 #ifdef HEADLESS_USE_EMBEDDED_RESOURCES 32 #ifdef HEADLESS_USE_EMBEDDED_RESOURCES
30 #include "headless/embedded_resource_pak.h" 33 #include "headless/embedded_resource_pak.h"
31 #endif 34 #endif
32 35
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 if (!base::PathExists(pak_file)) 265 if (!base::PathExists(pak_file))
263 pak_file = dir_module.Append(FILE_PATH_LITERAL("Resources/resources.pak")); 266 pak_file = dir_module.Append(FILE_PATH_LITERAL("Resources/resources.pak"));
264 #endif 267 #endif
265 ResourceBundle::GetSharedInstance().AddDataPackFromPath( 268 ResourceBundle::GetSharedInstance().AddDataPackFromPath(
266 pak_file, ui::SCALE_FACTOR_NONE); 269 pak_file, ui::SCALE_FACTOR_NONE);
267 #endif 270 #endif
268 } 271 }
269 272
270 content::ContentBrowserClient* 273 content::ContentBrowserClient*
271 HeadlessContentMainDelegate::CreateContentBrowserClient() { 274 HeadlessContentMainDelegate::CreateContentBrowserClient() {
272 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); 275 browser_client_ =
276 base::MakeUnique<HeadlessContentBrowserClient>(browser_.get());
273 return browser_client_.get(); 277 return browser_client_.get();
274 } 278 }
275 279
280 content::ContentRendererClient*
281 HeadlessContentMainDelegate::CreateContentRendererClient() {
282 renderer_client_ = base::MakeUnique<HeadlessContentRendererClient>();
283 return renderer_client_.get();
284 }
285
276 } // namespace headless 286 } // namespace headless
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698