admin
2020-06-10 a610f2ab6e543d2cb78c1ef212ac6a74ddc067d9
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
// Copyright © 2019 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.
 
#include "Stdafx.h"
#include <msclr/lock.h>
 
#include "Frame.h"
#include "Browser.h"
 
using namespace CefSharp::BrowserSubprocess;
 
///
// True if this object is currently attached to a valid frame.
///
/*--cef()--*/
bool Frame::IsValid::get()
{
    return _frame->IsValid();
}
 
///
// Execute undo in this frame.
///
/*--cef()--*/
void Frame::Undo()
{
    _frame->Undo();
}
 
///
// Execute redo in this frame.
///
/*--cef()--*/
void Frame::Redo()
{
    _frame->Redo();
}
 
///
// Execute cut in this frame.
///
/*--cef()--*/
void Frame::Cut()
{
    _frame->Cut();
}
 
///
// Execute copy in this frame.
///
/*--cef()--*/
void Frame::Copy()
{
    _frame->Copy();
}
 
///
// Execute paste in this frame.
///
/*--cef()--*/
void Frame::Paste()
{
    _frame->Paste();
}
 
///
// Execute delete in this frame.
///
/*--cef(capi_name=del)--*/
void Frame::Delete()
{
    _frame->Delete();
}
 
///
// Execute select all in this frame.
///
/*--cef()--*/
void Frame::SelectAll()
{
    _frame->SelectAll();
}
 
///
// Save this frame's HTML source to a temporary file and open it in the
// default text viewing application. This method can only be called from the
// browser process.
///
/*--cef()--*/
void Frame::ViewSource()
{
    throw gcnew NotImplementedException("Browser process only");
}
 
///
// Retrieve this frame's HTML source as a string sent to the specified
// visitor.
///
/*--cef()--*/
Task<String^>^ Frame::GetSourceAsync()
{
    throw gcnew NotImplementedException();
}
 
///
// Retrieve this frame's HTML source as a string sent to the specified
// visitor.
///
/*--cef()--*/
void Frame::GetSource(IStringVisitor^ visitor)
{
    throw gcnew NotImplementedException();
}
 
///
// Retrieve this frame's display text as a string sent to the specified
// visitor.
///
/*--cef()--*/
Task<String^>^ Frame::GetTextAsync()
{
    throw gcnew NotImplementedException();
}
 
///
// Retrieve this frame's display text as a string sent to the specified
// visitor.
///
/*--cef()--*/
void Frame::GetText(IStringVisitor^ visitor)
{
    throw gcnew NotImplementedException();
}
 
 
///
// Load the request represented by the |request| object.
///
/*--cef()--*/
void Frame::LoadRequest(IRequest^ request)
{
    throw gcnew NotImplementedException();
}
 
///
// Load the specified |url|.
///
/*--cef()--*/
void Frame::LoadUrl(String^ url)
{
    _frame->LoadURL(StringUtils::ToNative(url));
}
 
///
// Execute a string of JavaScript code in this frame. The |script_url|
// parameter is the URL where the script in question can be found, if any.
// The renderer may request this URL to show the developer the source of the
// error.  The |start_line| parameter is the base line number to use for error
// reporting.
///
/*--cef(optional_param=script_url)--*/
void Frame::ExecuteJavaScriptAsync(String^ code, String^ scriptUrl, int startLine)
{
    _frame->ExecuteJavaScript(StringUtils::ToNative(code), StringUtils::ToNative(scriptUrl), startLine);
}
 
Task<JavascriptResponse^>^ Frame::EvaluateScriptAsync(String^ script, String^ scriptUrl, int startLine, Nullable<TimeSpan> timeout)
{
    throw gcnew NotImplementedException();
}
 
///
// Returns true if this is the main (top-level) frame.
///
/*--cef()--*/
bool Frame::IsMain::get()
{
    return _frame->IsMain();
}
 
///
// Returns true if this is the focused frame.
///
/*--cef()--*/
bool Frame::IsFocused::get()
{
    return _frame->IsFocused();
}
 
///
// Returns the name for this frame. If the frame has an assigned name (for
// example, set via the iframe "name" attribute) then that value will be
// returned. Otherwise a unique name will be constructed based on the frame
// parent hierarchy. The main (top-level) frame will always have an empty name
// value.
///
/*--cef()--*/
String^ Frame::Name::get()
{
    return StringUtils::ToClr(_frame->GetName());
}
 
///
// Returns the globally unique identifier for this frame.
///
/*--cef()--*/
Int64 Frame::Identifier::get()
{
    return _frame->GetIdentifier();
}
 
///
// Returns the parent of this frame or NULL if this is the main (top-level)
// frame.
///
/*--cef()--*/
IFrame^ Frame::Parent::get()
{
    if (_parentFrame != nullptr)
    {
        return _parentFrame;
    }
 
    // Be paranoid about creating the cached IFrame.
    msclr::lock sync(_syncRoot);
 
    if (_parentFrame != nullptr)
    {
        return _parentFrame;
    }
 
    auto parent = _frame->GetParent();
 
    if (parent == nullptr)
    {
        return nullptr;
    }
 
    _parentFrame = gcnew Frame(parent);
 
    return _parentFrame;
}
 
///
// Returns the URL currently loaded in this frame.
///
/*--cef()--*/
String^ Frame::Url::get()
{
    return StringUtils::ToClr(_frame->GetURL());
}
 
///
// Returns the browser that this frame belongs to.
///
/*--cef()--*/
IBrowser^ Frame::Browser::get()
{
    if (_owningBrowser != nullptr)
    {
        return _owningBrowser;
    }
 
    // Be paranoid about creating the cached IBrowser.
    msclr::lock sync(_syncRoot);
 
    if (_owningBrowser != nullptr)
    {
        return _owningBrowser;
    }
 
    _owningBrowser = gcnew CefSharp::BrowserSubprocess::Browser(_frame->GetBrowser());
    return _owningBrowser;
}
 
IRequest^ Frame::CreateRequest(bool initializePostData)
{
    throw gcnew NotImplementedException();
}
 
IUrlRequest^ Frame::CreateUrlRequest(IRequest^ request, IUrlRequestClient^ client)
{
    throw gcnew NotImplementedException();
}
 
bool Frame::IsDisposed::get()
{
    return _disposed;
}