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

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

Issue 1891843004: [headless] AddWindowTreeClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to latest master 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 unified diff | Download patch
« no previous file with comments | « headless/public/headless_browser.h ('k') | headless/test/data/window_open.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 5 #ifndef HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 6 #define HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // TODO(skyostil): Replace this with an equivalent client API. 23 // TODO(skyostil): Replace this with an equivalent client API.
24 class Observer { 24 class Observer {
25 public: 25 public:
26 // All the following notifications will be called on browser main thread. 26 // All the following notifications will be called on browser main thread.
27 virtual void DocumentOnLoadCompletedInMainFrame() {} 27 virtual void DocumentOnLoadCompletedInMainFrame() {}
28 virtual void DidFinishNavigation(bool success) {} 28 virtual void DidFinishNavigation(bool success) {}
29 29
30 // Indicates that this HeadlessWebContents instance is now ready to be 30 // Indicates that this HeadlessWebContents instance is now ready to be
31 // inspected using a HeadlessDevToolsClient. 31 // inspected using a HeadlessDevToolsClient.
32 //
33 // TODO(altimin): Support this event for pages that aren't created by us.
32 virtual void DevToolsTargetReady() {} 34 virtual void DevToolsTargetReady() {}
33 35
34 protected: 36 protected:
35 Observer() {} 37 Observer() {}
36 virtual ~Observer() {} 38 virtual ~Observer() {}
37 39
38 private: 40 private:
39 DISALLOW_COPY_AND_ASSIGN(Observer); 41 DISALLOW_COPY_AND_ASSIGN(Observer);
40 }; 42 };
41 43
42 // Add or remove an observer to receive events from this WebContents. 44 // Add or remove an observer to receive events from this WebContents.
43 // |observer| must outlive this class or be removed prior to being destroyed. 45 // |observer| must outlive this class or be removed prior to being destroyed.
44 virtual void AddObserver(Observer* observer) = 0; 46 virtual void AddObserver(Observer* observer) = 0;
45 virtual void RemoveObserver(Observer* observer) = 0; 47 virtual void RemoveObserver(Observer* observer) = 0;
46 48
47 // Return a DevTools target corresponding to this tab. Note that this method 49 // Return a DevTools target corresponding to this tab. Note that this method
48 // won't return a valid value until Observer::DevToolsTargetReady has been 50 // won't return a valid value until Observer::DevToolsTargetReady has been
49 // signaled. 51 // signaled.
50 virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0; 52 virtual HeadlessDevToolsTarget* GetDevToolsTarget() = 0;
51 53
54 // Close this page. |HeadlessWebContents| object will be destroyed.
55 virtual void Close() = 0;
56
52 private: 57 private:
53 friend class HeadlessWebContentsImpl; 58 friend class HeadlessWebContentsImpl;
54 HeadlessWebContents() {} 59 HeadlessWebContents() {}
55 60
56 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents); 61 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents);
57 }; 62 };
58 63
59 } // namespace headless 64 } // namespace headless
60 65
61 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ 66 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_
OLDNEW
« no previous file with comments | « headless/public/headless_browser.h ('k') | headless/test/data/window_open.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698