| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // c) Calling HeadlessBrowser::Shutdown. | 52 // c) Calling HeadlessBrowser::Shutdown. |
| 53 virtual HeadlessWebContents::Builder CreateWebContentsBuilder() = 0; | 53 virtual HeadlessWebContents::Builder CreateWebContentsBuilder() = 0; |
| 54 | 54 |
| 55 // Returns all web contents owned by this browser context. | 55 // Returns all web contents owned by this browser context. |
| 56 virtual std::vector<HeadlessWebContents*> GetAllWebContents() = 0; | 56 virtual std::vector<HeadlessWebContents*> GetAllWebContents() = 0; |
| 57 | 57 |
| 58 // See HeadlessBrowser::GetWebContentsForDevToolsAgentHostId. | 58 // See HeadlessBrowser::GetWebContentsForDevToolsAgentHostId. |
| 59 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( | 59 virtual HeadlessWebContents* GetWebContentsForDevToolsAgentHostId( |
| 60 const std::string& devtools_agent_host_id) = 0; | 60 const std::string& devtools_agent_host_id) = 0; |
| 61 | 61 |
| 62 // Returns the frame tree node id for the corresponding RenderFrameHost or -1 |
| 63 // if it can't be found. Can be called on any thread. |
| 64 virtual int GetFrameTreeNodeId(int render_process_id, |
| 65 int render_frame_id) const = 0; |
| 66 |
| 62 // Destroy this BrowserContext and all WebContents associated with it. | 67 // Destroy this BrowserContext and all WebContents associated with it. |
| 63 virtual void Close() = 0; | 68 virtual void Close() = 0; |
| 64 | 69 |
| 65 // GUID for this browser context. | 70 // GUID for this browser context. |
| 66 virtual const std::string& Id() const = 0; | 71 virtual const std::string& Id() const = 0; |
| 67 | 72 |
| 68 // TODO(skyostil): Allow saving and restoring contexts (crbug.com/617931). | 73 // TODO(skyostil): Allow saving and restoring contexts (crbug.com/617931). |
| 69 | 74 |
| 70 protected: | 75 protected: |
| 71 HeadlessBrowserContext() {} | 76 HeadlessBrowserContext() {} |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 150 |
| 146 std::list<MojoBindings> mojo_bindings_; | 151 std::list<MojoBindings> mojo_bindings_; |
| 147 bool enable_http_and_https_if_mojo_used_; | 152 bool enable_http_and_https_if_mojo_used_; |
| 148 | 153 |
| 149 DISALLOW_COPY_AND_ASSIGN(Builder); | 154 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 150 }; | 155 }; |
| 151 | 156 |
| 152 } // namespace headless | 157 } // namespace headless |
| 153 | 158 |
| 154 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ | 159 #endif // HEADLESS_PUBLIC_HEADLESS_BROWSER_CONTEXT_H_ |
| OLD | NEW |