OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef HEADLESS_PUBLIC_WEB_CONTENTS_H_ | |
6 #define HEADLESS_PUBLIC_WEB_CONTENTS_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "url/gurl.h" | |
11 | |
12 class SkBitmap; | |
13 | |
14 namespace gfx { | |
Sami
2015/11/19 14:08:34
Looks like this isn't needed.
altimin
2015/11/19 14:52:54
Done.
| |
15 class Size; | |
16 } | |
17 | |
18 namespace content { | |
Sami
2015/11/19 14:08:34
Ditto.
altimin
2015/11/19 14:52:54
Done.
| |
19 class WebContents; | |
20 class BrowserContext; | |
21 } | |
22 | |
23 namespace aura { | |
Sami
2015/11/19 14:08:34
Ditto.
altimin
2015/11/19 14:52:54
Done.
| |
24 class WindowTreeHost; | |
25 } | |
26 | |
27 namespace headless { | |
28 | |
29 class WebFrame; | |
30 | |
31 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.
| |
32 public: | |
33 class Observer { | |
34 public: | |
35 // Will be called on browser thread. | |
36 virtual void DocumentOnLoadCompletedInMainFrame() = 0; | |
37 | |
38 protected: | |
39 Observer(WebContents* web_contents); | |
40 virtual ~Observer(); | |
41 | |
42 private: | |
43 class ObserverImpl; | |
44 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
| |
45 }; | |
46 | |
47 virtual scoped_ptr<WebFrame> main_frame(); | |
48 virtual void OpenURL(const GURL& url); | |
49 | |
50 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.
| |
51 virtual void GetScreenshot(const ScreenshotCallback& callback); | |
52 | |
53 protected: | |
54 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.
| |
55 }; | |
56 | |
57 } // namespace headless | |
58 | |
59 #endif // HEADLESS_PUBLIC_WEB_CONTENTS_H_ | |
OLD | NEW |