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

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

Issue 2780433002: add print to pdf for headless (Closed)
Patch Set: fix lint and style errors 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 pak_file = dir_module.Append(FILE_PATH_LITERAL("headless_lib.pak")); 262 pak_file = dir_module.Append(FILE_PATH_LITERAL("headless_lib.pak"));
260 if (!base::PathExists(pak_file)) 263 if (!base::PathExists(pak_file))
261 pak_file = dir_module.Append(FILE_PATH_LITERAL("resources.pak")); 264 pak_file = dir_module.Append(FILE_PATH_LITERAL("resources.pak"));
262 ResourceBundle::GetSharedInstance().AddDataPackFromPath( 265 ResourceBundle::GetSharedInstance().AddDataPackFromPath(
263 pak_file, ui::SCALE_FACTOR_NONE); 266 pak_file, ui::SCALE_FACTOR_NONE);
264 #endif 267 #endif
265 } 268 }
266 269
267 content::ContentBrowserClient* 270 content::ContentBrowserClient*
268 HeadlessContentMainDelegate::CreateContentBrowserClient() { 271 HeadlessContentMainDelegate::CreateContentBrowserClient() {
269 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); 272 browser_client_ =
273 base::MakeUnique<HeadlessContentBrowserClient>(browser_.get());
270 return browser_client_.get(); 274 return browser_client_.get();
271 } 275 }
272 276
277 content::ContentRendererClient*
278 HeadlessContentMainDelegate::CreateContentRendererClient() {
279 renderer_client_ = base::MakeUnique<HeadlessContentRendererClient>();
280 return renderer_client_.get();
281 }
282
273 } // namespace headless 283 } // namespace headless
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698