Index: headless/public/headless_browser_context.h |
diff --git a/headless/public/headless_browser_context.h b/headless/public/headless_browser_context.h |
index d041c0a3e923056a99c5421e013ee2730a40ffda..b6d41576621610ecf4c55451e7bc1f5600a4bed4 100644 |
--- a/headless/public/headless_browser_context.h |
+++ b/headless/public/headless_browser_context.h |
@@ -12,6 +12,7 @@ |
#include <vector> |
#include "base/optional.h" |
+#include "content/public/common/web_preferences.h" |
#include "headless/public/headless_export.h" |
#include "headless/public/headless_web_contents.h" |
#include "net/base/host_port_pair.h" |
@@ -25,6 +26,10 @@ namespace headless { |
class HeadlessBrowserImpl; |
class HeadlessBrowserContextOptions; |
+// Imported into headless namespace for |
+// Builder::SetOverrideWebPreferencesCallback(). |
+using content::WebPreferences; |
+ |
using ProtocolHandlerMap = std::unordered_map< |
std::string, |
std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>>; |
@@ -97,6 +102,14 @@ class HEADLESS_EXPORT HeadlessBrowserContext::Builder { |
Builder& EnableUnsafeNetworkAccessWithMojoBindings( |
bool enable_http_and_https_if_mojo_used); |
+ // Set a callback that is invoked to override WebPreferences for RenderViews |
+ // created within this HeadlessBrowserContext. |
Sami
2016/09/29 09:38:26
This is called on the browser main thread, right?
Eric Seckler
2016/09/30 09:17:50
It's definitely called multiple times (whenever th
|
+ // |
+ // WARNING: We cannot provide any guarantees about the stability of the |
+ // exposed WebPreferences API, so use with care. |
+ Builder& SetOverrideWebPreferencesCallback( |
+ std::function<void(WebPreferences*)> callback); |
Sami
2016/09/29 09:38:26
This should probably be a base::Callback since mos
Eric Seckler
2016/09/30 09:17:50
Done.
|
+ |
// By default |HeadlessBrowserContext| inherits the following options from |
// the browser instance. The methods below can be used to override these |
// settings. See HeadlessBrowser::Options for their meaning. |