OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_OPTIONS_H_ | |
6 #define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_OPTIONS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/files/file_path.h" | |
11 #include "base/optional.h" | |
12 #include "headless/public/headless_browser.h" | |
13 #include "headless/public/headless_browser_context.h" | |
14 | |
15 namespace headless { | |
16 | |
17 // Represents options which can be customized for a given BrowserContext. | |
18 // Provides a fallback to default browser-side options when an option | |
19 // is not set for a particular BrowserContext. | |
20 class HeadlessBrowserContextOptions { | |
21 public: | |
22 HeadlessBrowserContextOptions(HeadlessBrowserContextOptions&& options); | |
23 ~HeadlessBrowserContextOptions(); | |
24 | |
25 HeadlessBrowserContextOptions& operator=( | |
26 HeadlessBrowserContextOptions&& options); | |
27 | |
28 const std::string& user_agent() const; | |
29 | |
30 // See HeadlessBrowser::Options::proxy_server. | |
Sami
2016/08/03 11:20:30
Since this is an internal implementation class I d
altimin
2016/08/03 11:54:10
I think it's useful to distinguish overridden thin
| |
31 const net::HostPortPair& proxy_server() const; | |
32 | |
33 // See HeadlessBrowser::Options::host_resolver_rules. | |
34 const std::string& host_resolver_rules() const; | |
35 | |
36 // See HeadlessBrowser::Options::user_data_dir. | |
37 const base::FilePath& user_data_dir() const; | |
38 | |
39 // Custom network protocol handlers. These can be used to override URL | |
40 // fetching for different network schemes. | |
41 const ProtocolHandlerMap& protocol_handlers() const; | |
42 // Since ProtocolHandlerMap is move-only, this method takes ownership of them. | |
43 ProtocolHandlerMap TakeProtocolHandlers(); | |
44 | |
45 private: | |
46 friend class HeadlessBrowserContext::Builder; | |
47 | |
48 explicit HeadlessBrowserContextOptions(HeadlessBrowser::Options*); | |
49 | |
50 HeadlessBrowser::Options* browser_options_; | |
51 | |
52 base::Optional<std::string> user_agent_; | |
53 base::Optional<net::HostPortPair> proxy_server_; | |
54 base::Optional<std::string> host_resolver_rules_; | |
55 base::Optional<base::FilePath> user_data_dir_; | |
56 | |
57 ProtocolHandlerMap protocol_handlers_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContextOptions); | |
alex clarke (OOO till 29th)
2016/08/03 11:55:19
I wonder if it would be simpler to remove this mac
altimin
2016/08/03 12:46:18
I believe that in this case copy constructor is ge
| |
60 }; | |
61 | |
62 } // namespace headless | |
63 | |
64 #endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_OPTIONS_H_ | |
OLD | NEW |