OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // | 99 // |
100 // That said, best pratice is to add a ProtocolHandler to serve the | 100 // That said, best pratice is to add a ProtocolHandler to serve the |
101 // webcontent over a custom protocol. That way you can be sure that only the | 101 // webcontent over a custom protocol. That way you can be sure that only the |
102 // things you intend have access to mojo. | 102 // things you intend have access to mojo. |
103 Builder& EnableUnsafeNetworkAccessWithMojoBindings( | 103 Builder& EnableUnsafeNetworkAccessWithMojoBindings( |
104 bool enable_http_and_https_if_mojo_used); | 104 bool enable_http_and_https_if_mojo_used); |
105 | 105 |
106 // By default |HeadlessBrowserContext| inherits the following options from | 106 // By default |HeadlessBrowserContext| inherits the following options from |
107 // the browser instance. The methods below can be used to override these | 107 // the browser instance. The methods below can be used to override these |
108 // settings. See HeadlessBrowser::Options for their meaning. | 108 // settings. See HeadlessBrowser::Options for their meaning. |
| 109 Builder& SetProductNameAndVersion( |
| 110 const std::string& product_name_and_version); |
109 Builder& SetUserAgent(const std::string& user_agent); | 111 Builder& SetUserAgent(const std::string& user_agent); |
110 Builder& SetProxyServer(const net::HostPortPair& proxy_server); | 112 Builder& SetProxyServer(const net::HostPortPair& proxy_server); |
111 Builder& SetHostResolverRules(const std::string& host_resolver_rules); | 113 Builder& SetHostResolverRules(const std::string& host_resolver_rules); |
112 Builder& SetWindowSize(const gfx::Size& window_size); | 114 Builder& SetWindowSize(const gfx::Size& window_size); |
113 Builder& SetUserDataDir(const base::FilePath& user_data_dir); | 115 Builder& SetUserDataDir(const base::FilePath& user_data_dir); |
114 Builder& SetIncognitoMode(bool incognito_mode); | 116 Builder& SetIncognitoMode(bool incognito_mode); |
115 Builder& SetOverrideWebPreferencesCallback( | 117 Builder& SetOverrideWebPreferencesCallback( |
116 base::Callback<void(WebPreferences*)> callback); | 118 base::Callback<void(WebPreferences*)> callback); |
117 | 119 |
118 HeadlessBrowserContext* Build(); | 120 HeadlessBrowserContext* Build(); |
(...skipping 21 matching lines...) Expand all Loading... |
140 | 142 |
141 std::list<MojoBindings> mojo_bindings_; | 143 std::list<MojoBindings> mojo_bindings_; |
142 bool enable_http_and_https_if_mojo_used_; | 144 bool enable_http_and_https_if_mojo_used_; |
143 | 145 |
144 DISALLOW_COPY_AND_ASSIGN(Builder); | 146 DISALLOW_COPY_AND_ASSIGN(Builder); |
145 }; | 147 }; |
146 | 148 |
147 } // namespace headless | 149 } // namespace headless |
148 | 150 |
149 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 151 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
OLD | NEW |