OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_H_ | 5 #ifndef HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 6 #define HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Create a new browser context which can be used to create tabs and isolate | 40 // Create a new browser context which can be used to create tabs and isolate |
41 // them from one another. | 41 // them from one another. |
42 // Pointer to HeadlessBrowserContext becomes invalid after: | 42 // Pointer to HeadlessBrowserContext becomes invalid after: |
43 // a) Calling HeadlessBrowserContext::Close or | 43 // a) Calling HeadlessBrowserContext::Close or |
44 // b) Calling HeadlessBrowser::Shutdown | 44 // b) Calling HeadlessBrowser::Shutdown |
45 virtual HeadlessBrowserContext::Builder CreateBrowserContextBuilder() = 0; | 45 virtual HeadlessBrowserContext::Builder CreateBrowserContextBuilder() = 0; |
46 | 46 |
47 virtual std::vector<HeadlessBrowserContext*> GetAllBrowserContexts() = 0; | 47 virtual std::vector<HeadlessBrowserContext*> GetAllBrowserContexts() = 0; |
48 | 48 |
| 49 // Return a DevTools target corresponding to this browser. Note that this |
| 50 // method only returns a valid target after browser has been initialized on |
| 51 // the main thread. The target only supports the domains available on the |
| 52 // browser endpoint excluding the Tethering domain. |
| 53 virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0; |
| 54 |
49 // Returns the HeadlessWebContents associated with the | 55 // Returns the HeadlessWebContents associated with the |
50 // |devtools_agent_host_id| if any. Otherwise returns null. | 56 // |devtools_agent_host_id| if any. Otherwise returns null. |
51 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( | 57 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( |
52 const std::string& devtools_agent_host_id) = 0; | 58 const std::string& devtools_agent_host_id) = 0; |
53 | 59 |
54 // Returns HeadlessBrowserContext associated with the given id if any. | 60 // Returns HeadlessBrowserContext associated with the given id if any. |
55 // Otherwise returns null. | 61 // Otherwise returns null. |
56 virtual HeadlessBrowserContext* GetBrowserContextForId( | 62 virtual HeadlessBrowserContext* GetBrowserContextForId( |
57 const std::string& id) = 0; | 63 const std::string& id) = 0; |
58 | 64 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // the main loop, it will only return after HeadlessBrowser::Shutdown() is | 243 // the main loop, it will only return after HeadlessBrowser::Shutdown() is |
238 // called, returning the exit code for the process. It is not possible to | 244 // called, returning the exit code for the process. It is not possible to |
239 // initialize the browser again after it has been torn down. | 245 // initialize the browser again after it has been torn down. |
240 int HeadlessBrowserMain( | 246 int HeadlessBrowserMain( |
241 HeadlessBrowser::Options options, | 247 HeadlessBrowser::Options options, |
242 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); | 248 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); |
243 | 249 |
244 } // namespace headless | 250 } // namespace headless |
245 | 251 |
246 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 252 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
OLD | NEW |