Index: headless/public/web_contents.h |
diff --git a/headless/public/web_contents.h b/headless/public/web_contents.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ee879ccd1120abe2fcd8b47a53367d259605dfe7 |
--- /dev/null |
+++ b/headless/public/web_contents.h |
@@ -0,0 +1,59 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef HEADLESS_PUBLIC_WEB_CONTENTS_H_ |
+#define HEADLESS_PUBLIC_WEB_CONTENTS_H_ |
+ |
+#include "base/callback.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "url/gurl.h" |
+ |
+class SkBitmap; |
+ |
+namespace gfx { |
Sami
2015/11/19 14:08:34
Looks like this isn't needed.
altimin
2015/11/19 14:52:54
Done.
|
+class Size; |
+} |
+ |
+namespace content { |
Sami
2015/11/19 14:08:34
Ditto.
altimin
2015/11/19 14:52:54
Done.
|
+class WebContents; |
+class BrowserContext; |
+} |
+ |
+namespace aura { |
Sami
2015/11/19 14:08:34
Ditto.
altimin
2015/11/19 14:52:54
Done.
|
+class WindowTreeHost; |
+} |
+ |
+namespace headless { |
+ |
+class WebFrame; |
+ |
+class WebContents { |
Sami
2015/11/19 14:08:34
Some documentation also here would be nice. Especi
altimin
2015/11/19 14:52:54
Done.
|
+ public: |
+ class Observer { |
+ public: |
+ // Will be called on browser thread. |
+ virtual void DocumentOnLoadCompletedInMainFrame() = 0; |
+ |
+ protected: |
+ Observer(WebContents* web_contents); |
+ virtual ~Observer(); |
+ |
+ private: |
+ class ObserverImpl; |
+ scoped_ptr<ObserverImpl> observer_; |
Sami
2015/11/19 14:08:34
Why do we need an impl pointer here? Seems like we
altimin
2015/11/19 14:52:54
Yes, we need to have content::WebContentsObserver
|
+ }; |
+ |
+ virtual scoped_ptr<WebFrame> main_frame(); |
+ virtual void OpenURL(const GURL& url); |
+ |
+ typedef base::Callback<void(scoped_ptr<SkBitmap>)> ScreenshotCallback; |
Sami
2015/11/19 14:08:34
nit: "using" is a little neater than typedef.
altimin
2015/11/19 14:52:54
Done.
|
+ virtual void GetScreenshot(const ScreenshotCallback& callback); |
+ |
+ protected: |
+ virtual ~WebContents(){}; |
Sami
2015/11/19 14:08:34
nit: missing space before {}
altimin
2015/11/19 14:52:54
It's git cl format behaviour.
|
+}; |
+ |
+} // namespace headless |
+ |
+#endif // HEADLESS_PUBLIC_WEB_CONTENTS_H_ |