Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1368)

Unified Diff: headless/public/headless_web_contents.h

Issue 1805983002: headless: Implement client API generation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make PendingMessage moveable Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {}

Powered by Google App Engine
This is Rietveld 408576698