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

Unified Diff: headless/lib/browser/headless_devtools_manager_delegate.h

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 side-by-side diff with in-line comments
Download patch
Index: headless/lib/browser/headless_devtools_manager_delegate.h
diff --git a/headless/lib/browser/headless_devtools_manager_delegate.h b/headless/lib/browser/headless_devtools_manager_delegate.h
index 6c2a65912567525a7e4dd173b3fb09b16898dec0..300cd2460080b721313de89470b085a6076d15cd 100644
--- a/headless/lib/browser/headless_devtools_manager_delegate.h
+++ b/headless/lib/browser/headless_devtools_manager_delegate.h
@@ -27,6 +27,9 @@ class HeadlessDevToolsManagerDelegate
// DevToolsManagerDelegate implementation:
base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host,
base::DictionaryValue* command) override;
+ bool HandleAsyncCommand(content::DevToolsAgentHost* agent_host,
+ base::DictionaryValue* command,
+ const CommandCallback& callback) override;
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
const GURL& url) override;
std::string GetDiscoveryPageHTML() override;
@@ -45,6 +48,10 @@ class HeadlessDevToolsManagerDelegate
std::unique_ptr<base::DictionaryValue> DisposeBrowserContext(
int command_id,
const base::DictionaryValue* params);
+ void PrintToPDF(content::DevToolsAgentHost* agent_host,
+ int command_id,
+ const base::DictionaryValue* params,
+ const CommandCallback& callback);
base::WeakPtr<HeadlessBrowserImpl> browser_;
@@ -52,7 +59,13 @@ class HeadlessDevToolsManagerDelegate
base::Callback<std::unique_ptr<base::DictionaryValue>(
int command_id,
const base::DictionaryValue* params)>;
+ using AsyncCommandMemberCallback =
+ base::Callback<void(content::DevToolsAgentHost* agent_host,
+ int command_id,
+ const base::DictionaryValue* params,
+ const CommandCallback& callback)>;
std::map<std::string, CommandMemberCallback> command_map_;
+ std::map<std::string, AsyncCommandMemberCallback> async_command_map_;
};
} // namespace headless

Powered by Google App Engine
This is Rietveld 408576698