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

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

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fine, no console logging Mr. Presubmit. Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « headless/public/headless_browser.cc ('k') | headless/public/network.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_HEADLESS_WEB_CONTENTS_H_
6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "headless/public/headless_export.h"
12 #include "url/gurl.h"
13
14 namespace headless {
15
16 // Class representing contents of a browser tab. Should be accessed from browser
17 // main thread.
18 class HEADLESS_EXPORT HeadlessWebContents {
19 public:
20 virtual ~HeadlessWebContents() {}
21
22 // TODO(skyostil): Replace this with an equivalent client API.
23 class Observer {
24 public:
25 // Will be called on browser thread.
26 virtual void DocumentOnLoadCompletedInMainFrame() = 0;
27
28 protected:
29 Observer() {}
30 virtual ~Observer() {}
31
32 private:
33 DISALLOW_COPY_AND_ASSIGN(Observer);
34 };
35
36 // TODO(skyostil): Replace this with an equivalent client API.
37 virtual bool OpenURL(const GURL& url) = 0;
38
39 // Add or remove an observer to receive events from this WebContents.
40 // |observer| must outlive this class or be removed prior to being destroyed.
41 virtual void AddObserver(Observer* observer) = 0;
42 virtual void RemoveObserver(Observer* observer) = 0;
43
44 private:
45 friend class HeadlessWebContentsImpl;
46 HeadlessWebContents() {}
47
48 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents);
49 };
50
51 } // namespace headless
52
53 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
OLDNEW
« no previous file with comments | « headless/public/headless_browser.cc ('k') | headless/public/network.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698