| 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_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Takes ownership of |web_contents|. | 48 // Takes ownership of |web_contents|. |
| 49 static std::unique_ptr<HeadlessWebContentsImpl> CreateFromWebContents( | 49 static std::unique_ptr<HeadlessWebContentsImpl> CreateFromWebContents( |
| 50 content::WebContents* web_contents, | 50 content::WebContents* web_contents, |
| 51 HeadlessBrowserContextImpl* browser_context); | 51 HeadlessBrowserContextImpl* browser_context); |
| 52 | 52 |
| 53 // HeadlessWebContents implementation: | 53 // HeadlessWebContents implementation: |
| 54 void AddObserver(Observer* observer) override; | 54 void AddObserver(Observer* observer) override; |
| 55 void RemoveObserver(Observer* observer) override; | 55 void RemoveObserver(Observer* observer) override; |
| 56 HeadlessDevToolsTarget* GetDevToolsTarget() override; | 56 HeadlessDevToolsTarget* GetDevToolsTarget() override; |
| 57 content::WebContents* GetWebContents() const override; |
| 57 | 58 |
| 58 // HeadlessDevToolsTarget implementation: | 59 // HeadlessDevToolsTarget implementation: |
| 59 void AttachClient(HeadlessDevToolsClient* client) override; | 60 void AttachClient(HeadlessDevToolsClient* client) override; |
| 60 void DetachClient(HeadlessDevToolsClient* client) override; | 61 void DetachClient(HeadlessDevToolsClient* client) override; |
| 61 | 62 |
| 62 // content::WebContentsObserver implementation: | 63 // content::WebContentsObserver implementation: |
| 63 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; | 64 void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; |
| 64 | 65 |
| 65 content::WebContents* web_contents() const; | |
| 66 bool OpenURL(const GURL& url); | 66 bool OpenURL(const GURL& url); |
| 67 | 67 |
| 68 void Close() override; | 68 void Close() override; |
| 69 | 69 |
| 70 std::string GetDevToolsAgentHostId(); | 70 std::string GetDevToolsAgentHostId(); |
| 71 | 71 |
| 72 HeadlessBrowserImpl* browser() const; | 72 HeadlessBrowserImpl* browser() const; |
| 73 HeadlessBrowserContextImpl* browser_context() const; | 73 HeadlessBrowserContextImpl* browser_context() const; |
| 74 | 74 |
| 75 private: | 75 private: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 94 std::unordered_map<HeadlessWebContents::Observer*, | 94 std::unordered_map<HeadlessWebContents::Observer*, |
| 95 std::unique_ptr<WebContentsObserverAdapter>>; | 95 std::unique_ptr<WebContentsObserverAdapter>>; |
| 96 ObserverMap observer_map_; | 96 ObserverMap observer_map_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl); | 98 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContentsImpl); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace headless | 101 } // namespace headless |
| 102 | 102 |
| 103 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ | 103 #endif // HEADLESS_LIB_BROWSER_HEADLESS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |