-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CefBrowserWrapper.h
198 lines (168 loc) · 5.14 KB
/
CefBrowserWrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include <include/cef_browser.h>
#include "CefWrapper.h"
namespace CefSharp
{
namespace Internals
{
private ref class CefBrowserWrapper : public IBrowser, public CefWrapper
{
private:
MCefRefPtr<CefBrowser> _browser;
IBrowserHost^ _browserHost;
internal:
CefBrowserWrapper::CefBrowserWrapper(CefRefPtr<CefBrowser> &browser)
: _browser(browser), _browserHost(nullptr)
{
}
!CefBrowserWrapper()
{
// Release the reference.
_browser = nullptr;
}
~CefBrowserWrapper()
{
this->!CefBrowserWrapper();
delete _browserHost;
_browserHost = nullptr;
_disposed = true;
}
virtual property MCefRefPtr<CefBrowser> Browser
{
MCefRefPtr<CefBrowser> get();
}
public:
virtual property bool IsValid
{
bool get();
}
///
// Returns the browser host object. This method can only be called in the
// browser process.
///
/*--cef()--*/
virtual IBrowserHost^ GetHost();
///
// Returns true if the browser can navigate backwards.
///
/*--cef()--*/
virtual property bool CanGoBack
{
bool get();
}
///
// Navigate backwards.
///
/*--cef()--*/
virtual void GoBack();
///
// Returns true if the browser can navigate forwards.
///
/*--cef()--*/
virtual property bool CanGoForward
{
bool get();
}
///
// Navigate forwards.
///
/*--cef()--*/
virtual void GoForward();
///
// Returns true if the browser is currently loading.
///
/*--cef()--*/
virtual property bool IsLoading
{
bool get();
}
virtual void CloseBrowser(bool forceClose);
///
// Reload the current page.
///
/*--cef()--*/
virtual void Reload(bool ignoreCache);
///
// Stop loading the page.
///
/*--cef()--*/
virtual void StopLoad();
///
// Returns the globally unique identifier for this browser.
///
/*--cef()--*/
virtual property int Identifier
{
int get();
}
///
// Returns true if this object is pointing to the same handle as |that|
// object.
///
/*--cef()--*/
virtual bool IsSame(IBrowser^ that);
///
// Returns true if the window is a popup window.
///
/*--cef()--*/
virtual property bool IsPopup
{
bool get();
}
///
// Returns true if a document has been loaded in the browser.
///
/*--cef()--*/
virtual property bool HasDocument
{
bool get();
}
///
// Returns the main (top-level) frame for the browser window.
///
/*--cef()--*/
virtual property IFrame^ MainFrame
{
IFrame^ get();
}
///
// Returns the focused frame for the browser window.
///
/*--cef()--*/
virtual property IFrame^ FocusedFrame
{
IFrame^ get();
}
///
// Returns the frame with the specified identifier, or NULL if not found.
///
/*--cef(capi_name=get_frame_byident)--*/
virtual IFrame^ GetFrameByIdentifier(String^ identifier);
///
// Returns the frame with the specified name, or NULL if not found.
///
/*--cef(optional_param=name)--*/
virtual IFrame^ GetFrameByName(String^ name);
///
// Returns the number of frames that currently exist.
///
/*--cef()--*/
virtual int GetFrameCount();
///
// Returns the identifiers of all existing frames.
///
/*--cef(count_func=identifiers:GetFrameCount)--*/
virtual List<String^>^ GetFrameIdentifiers();
///
// Returns the names of all existing frames.
///
/*--cef()--*/
virtual List<String^>^ GetFrameNames();
virtual IReadOnlyCollection<IFrame^>^ GetAllFrames();
};
}
}