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

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

Issue 2374063002: Headless: expose WebPreferences to embedder, add --hide-scrollbars. (Closed)
Patch Set: Created 4 years, 3 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_browser_context_options.h
diff --git a/headless/lib/browser/headless_browser_context_options.h b/headless/lib/browser/headless_browser_context_options.h
index af9b8939c6e4c754c4daf2c35cbb42de0e0ee0fb..e0e060e067522b289a91f5f1ec163b6e92e7ac3b 100644
--- a/headless/lib/browser/headless_browser_context_options.h
+++ b/headless/lib/browser/headless_browser_context_options.h
@@ -47,6 +47,11 @@ class HeadlessBrowserContextOptions {
// Since ProtocolHandlerMap is move-only, this method takes ownership of them.
ProtocolHandlerMap TakeProtocolHandlers();
+ // Callback that is invoked to override WebPreferences for RenderViews
+ // created within this HeadlessBrowserContext.
+ const std::function<void(WebPreferences*)>&
+ override_web_preferences_callback() const;
+
private:
friend class HeadlessBrowserContext::Builder;
@@ -62,6 +67,7 @@ class HeadlessBrowserContextOptions {
base::Optional<bool> incognito_mode_;
ProtocolHandlerMap protocol_handlers_;
+ std::function<void(WebPreferences*)> override_web_preferences_callback_;
DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContextOptions);
};

Powered by Google App Engine
This is Rietveld 408576698