Index: headless/public/headless_web_contents.h |
diff --git a/headless/public/headless_web_contents.h b/headless/public/headless_web_contents.h |
index 04ac953001d61b94e9d9bab75de4ea1a931ef0fa..d9b29b7c9daadd08ac2ea8eb0ac02f2be281d62d 100644 |
--- a/headless/public/headless_web_contents.h |
+++ b/headless/public/headless_web_contents.h |
@@ -12,6 +12,7 @@ |
#include "url/gurl.h" |
namespace headless { |
+class HeadlessDevToolsTarget; |
// Class representing contents of a browser tab. Should be accessed from browser |
// main thread. |
@@ -23,12 +24,12 @@ class HEADLESS_EXPORT HeadlessWebContents { |
class Observer { |
public: |
// All the following notifications will be called on browser main thread. |
- virtual void DocumentOnLoadCompletedInMainFrame(){}; |
- virtual void DidFinishNavigation(bool success){}; |
+ virtual void DocumentOnLoadCompletedInMainFrame() {} |
+ virtual void DidFinishNavigation(bool success) {} |
- // After this event, this HeadlessWebContents instance is ready to be |
- // controlled using a DevTools client. |
- virtual void WebContentsReady(){}; |
+ // Indicates that this HeadlessWebContents instance is now ready to be |
+ // inspected using a HeadlessDevToolsClient. |
+ virtual void DevToolsTargetReady() {} |
protected: |
Observer() {} |
@@ -43,6 +44,11 @@ class HEADLESS_EXPORT HeadlessWebContents { |
virtual void AddObserver(Observer* observer) = 0; |
virtual void RemoveObserver(Observer* observer) = 0; |
+ // Return a DevTools target corresponding to this tab. Note that this method |
+ // won't return a valid value until Observer::DevToolsTargetReady has been |
+ // signaled. |
+ virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0; |
+ |
private: |
friend class HeadlessWebContentsImpl; |
HeadlessWebContents() {} |