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

Side by Side Diff: headless/public/web_contents.h

Issue 1461693003: [headless] Initial skeleton of headless/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DEPS to correct directory Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698