| 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 30 matching lines...) Expand all Loading... |
| 41 // Open a new tab. Returns a builder object which can be used to set | 41 // Open a new tab. Returns a builder object which can be used to set |
| 42 // properties for the new tab. | 42 // properties for the new tab. |
| 43 virtual HeadlessWebContents::Builder CreateWebContentsBuilder() = 0; | 43 virtual HeadlessWebContents::Builder CreateWebContentsBuilder() = 0; |
| 44 | 44 |
| 45 // Deprecated. Use CreateWebContentsBuilder() instead. | 45 // Deprecated. Use CreateWebContentsBuilder() instead. |
| 46 virtual HeadlessWebContents* CreateWebContents(const GURL& initial_url, | 46 virtual HeadlessWebContents* CreateWebContents(const GURL& initial_url, |
| 47 const gfx::Size& size) = 0; | 47 const gfx::Size& size) = 0; |
| 48 | 48 |
| 49 virtual std::vector<HeadlessWebContents*> GetAllWebContents() = 0; | 49 virtual std::vector<HeadlessWebContents*> GetAllWebContents() = 0; |
| 50 | 50 |
| 51 // Returns the HeadlessWebContents associated with the |
| 52 // |devtools_agent_host_id| if any. Otherwise returns null. |
| 53 virtual HeadlessWebContents* GetWebContentsForDevtoolsAgentHostId( |
| 54 const std::string& devtools_agent_host_id) = 0; |
| 55 |
| 51 // Returns a task runner for submitting work to the browser main thread. | 56 // Returns a task runner for submitting work to the browser main thread. |
| 52 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() | 57 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserMainThread() |
| 53 const = 0; | 58 const = 0; |
| 54 | 59 |
| 55 // Returns a task runner for submitting work to the browser file thread. | 60 // Returns a task runner for submitting work to the browser file thread. |
| 56 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() | 61 virtual scoped_refptr<base::SingleThreadTaskRunner> BrowserFileThread() |
| 57 const = 0; | 62 const = 0; |
| 58 | 63 |
| 59 // Requests browser to stop as soon as possible. |Run| will return as soon as | 64 // Requests browser to stop as soon as possible. |Run| will return as soon as |
| 60 // browser stops. | 65 // browser stops. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // the main loop, it will only return after HeadlessBrowser::Shutdown() is | 172 // the main loop, it will only return after HeadlessBrowser::Shutdown() is |
| 168 // called, returning the exit code for the process. It is not possible to | 173 // called, returning the exit code for the process. It is not possible to |
| 169 // initialize the browser again after it has been torn down. | 174 // initialize the browser again after it has been torn down. |
| 170 int HeadlessBrowserMain( | 175 int HeadlessBrowserMain( |
| 171 HeadlessBrowser::Options options, | 176 HeadlessBrowser::Options options, |
| 172 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); | 177 const base::Callback<void(HeadlessBrowser*)>& on_browser_start_callback); |
| 173 | 178 |
| 174 } // namespace headless | 179 } // namespace headless |
| 175 | 180 |
| 176 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ | 181 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_H_ |
| OLD | NEW |