|
@@ -2248,6 +2248,34 @@ v8::Local<v8::Promise> WebContents::CapturePage(mate::Arguments* mate_args) {
|
|
|
return handle;
|
|
|
}
|
|
|
|
|
|
+void WebContents::IncrementCapturerCount(mate::Arguments* mate_args) {
|
|
|
+ gin::Arguments gin_args(mate_args->info());
|
|
|
+ gin_helper::Arguments* args = static_cast<gin_helper::Arguments*>(&gin_args);
|
|
|
+
|
|
|
+ gfx::Size size;
|
|
|
+ bool stay_hidden = false;
|
|
|
+
|
|
|
+ // get size arguments if they exist
|
|
|
+ args->GetNext(&size);
|
|
|
+ // get stayHidden arguments if they exist
|
|
|
+ args->GetNext(&stay_hidden);
|
|
|
+
|
|
|
+ web_contents()->IncrementCapturerCount(size, stay_hidden);
|
|
|
+}
|
|
|
+
|
|
|
+void WebContents::DecrementCapturerCount(mate::Arguments* args) {
|
|
|
+ bool stay_hidden = false;
|
|
|
+
|
|
|
+ // get stayHidden arguments if they exist
|
|
|
+ args->GetNext(&stay_hidden);
|
|
|
+
|
|
|
+ web_contents()->DecrementCapturerCount(stay_hidden);
|
|
|
+}
|
|
|
+
|
|
|
+bool WebContents::IsBeingCaptured() {
|
|
|
+ return web_contents()->IsBeingCaptured();
|
|
|
+}
|
|
|
+
|
|
|
void WebContents::OnCursorChange(const content::WebCursor& cursor) {
|
|
|
const content::CursorInfo& info = cursor.info();
|
|
|
|
|
@@ -2627,6 +2655,9 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
|
|
|
.SetMethod("setEmbedder", &WebContents::SetEmbedder)
|
|
|
.SetMethod("setDevToolsWebContents", &WebContents::SetDevToolsWebContents)
|
|
|
.SetMethod("getNativeView", &WebContents::GetNativeView)
|
|
|
+ .SetMethod("incrementCapturerCount", &WebContents::IncrementCapturerCount)
|
|
|
+ .SetMethod("decrementCapturerCount", &WebContents::DecrementCapturerCount)
|
|
|
+ .SetMethod("isBeingCaptured", &WebContents::IsBeingCaptured)
|
|
|
.SetMethod("setWebRTCIPHandlingPolicy",
|
|
|
&WebContents::SetWebRTCIPHandlingPolicy)
|
|
|
.SetMethod("getWebRTCIPHandlingPolicy",
|