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

Unified Diff: headless/app/headless_shell.h

Issue 2780433002: add print to pdf for headless (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: headless/app/headless_shell.h
diff --git a/headless/app/headless_shell.h b/headless/app/headless_shell.h
index 4b0e83f6cbf3e5dd9f19b495af98d69e60599296..8d8a859cebb3ffdbca9bc120668122c5ad819055 100644
--- a/headless/app/headless_shell.h
+++ b/headless/app/headless_shell.h
@@ -63,17 +63,21 @@ class HeadlessShell : public HeadlessWebContents::Observer,
void OnScreenshotCaptured(
std::unique_ptr<page::CaptureScreenshotResult> result);
- void OnScreenshotFileOpened(
- std::unique_ptr<page::CaptureScreenshotResult> result,
- const base::FilePath file_name,
- base::File::Error error_code);
-
- void OnScreenshotFileWritten(const base::FilePath file_name,
- const int length,
- base::File::Error error_code,
- int write_result);
-
- void OnScreenshotFileClosed(base::File::Error error_code);
+ void PrintToPDF();
+
+ void OnPDFCreated(std::unique_ptr<page::PrintToPDFResult> result);
+
+ void WriteFile(const std::string& switch_string,
+ const std::string& default_file_name,
+ const std::string& data);
+ void OnFileOpened(const std::string& data,
+ const base::FilePath file_name,
+ base::File::Error error_code);
+ void OnFileWritten(const base::FilePath file_name,
+ const int length,
+ base::File::Error error_code,
+ int write_result);
+ void OnFileClosed(base::File::Error error_code);
bool RemoteDebuggingEnabled() const;
@@ -87,7 +91,7 @@ class HeadlessShell : public HeadlessWebContents::Observer,
std::unique_ptr<HeadlessDevToolsClient> devtools_client_;
HeadlessWebContents* web_contents_;
bool processed_page_ready_;
- std::unique_ptr<base::FileProxy> screenshot_file_proxy_;
+ std::unique_ptr<base::FileProxy> file_proxy_;
HeadlessBrowserContext* browser_context_;
std::unique_ptr<DeterministicDispatcher> deterministic_dispatcher_;
base::WeakPtrFactory<HeadlessShell> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698