OLD | NEW |
---|---|
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 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(Observer); | 38 DISALLOW_COPY_AND_ASSIGN(Observer); |
39 }; | 39 }; |
40 | 40 |
41 // Add or remove an observer to receive events from this WebContents. | 41 // Add or remove an observer to receive events from this WebContents. |
42 // |observer| must outlive this class or be removed prior to being destroyed. | 42 // |observer| must outlive this class or be removed prior to being destroyed. |
43 virtual void AddObserver(Observer* observer) = 0; | 43 virtual void AddObserver(Observer* observer) = 0; |
44 virtual void RemoveObserver(Observer* observer) = 0; | 44 virtual void RemoveObserver(Observer* observer) = 0; |
45 | 45 |
46 // True if this WebContents was created by calling | |
47 // HeadlessBrowser::CreateWebContents, false otherwise (e.g. by calling | |
48 // window.open()) | |
49 virtual bool IsDirectlyCreated() const = 0; | |
Sami
2016/04/20 16:38:50
I would suggest leaving this out, since the client
altimin
2016/04/20 17:35:25
Done.
| |
50 | |
51 // Close this page. |HeadlessWebContents| object will be destroyed. | |
52 virtual void Close() = 0; | |
53 | |
46 private: | 54 private: |
47 friend class HeadlessWebContentsImpl; | 55 friend class HeadlessWebContentsImpl; |
48 HeadlessWebContents() {} | 56 HeadlessWebContents() {} |
49 | 57 |
50 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents); | 58 DISALLOW_COPY_AND_ASSIGN(HeadlessWebContents); |
51 }; | 59 }; |
52 | 60 |
53 } // namespace headless | 61 } // namespace headless |
54 | 62 |
55 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ | 63 #endif // HEADLESS_PUBLIC_HEADLESS_WEB_CONTENTS_H_ |
OLD | NEW |