-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for Win32, WPF, WinForms, UWP and WinUI3 sample apps from 126…
….0.2584.0
- Loading branch information
1 parent
bce5a77
commit 9131ae5
Showing
11 changed files
with
188 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (C) Microsoft Corporation. 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 "ScenarioScreenCapture.h" | ||
|
||
#include "AppWindow.h" | ||
#include "CheckFailure.h" | ||
|
||
using namespace Microsoft::WRL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (C) Microsoft Corporation. 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 <string> | ||
|
||
#include "AppWindow.h" | ||
#include "ComponentBase.h" |
32 changes: 32 additions & 0 deletions
32
SampleApps/WebView2APISample/ScenarioScreenCaptureIFrame2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ScenarioScreenCaptureIFrame2</title> | ||
</head> | ||
<body> | ||
<h1>Screen Capture Test From Top Level IFrame 2</h1> | ||
<button onclick="testScreenCapture()">Screen Capture Test</button> | ||
<button id="toggleButton" onclick="toggleStatus()">Disable</button> | ||
<div id="statusDisplay"></div> | ||
<script> | ||
function testScreenCapture() { | ||
navigator.mediaDevices.getDisplayMedia(); | ||
} | ||
|
||
function toggleStatus() { | ||
var button = document.getElementById('toggleButton'); | ||
var statusDisplay = document.getElementById('statusDisplay'); | ||
if (button.innerHTML === "Enable") { | ||
chrome.webview.postMessage("EnableScreenCapture"); | ||
button.innerHTML = "Disable"; | ||
statusDisplay.innerHTML = "Status: Enabled"; | ||
} else { | ||
chrome.webview.postMessage("DisableScreenCapture"); | ||
button.innerHTML = "Enable"; | ||
statusDisplay.innerHTML = "Status: Disabled"; | ||
} | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
SampleApps/WebView2APISample/assets/ScenarioScreenCapture.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ScenarioScreenCapture</title> | ||
</head> | ||
<body> | ||
<h1>ScenarioScreenCapture Sample Page</h1> | ||
<h1>Screen Capture Test From Main Frame</h1> | ||
<button onclick="testScreenCapture()">Screen Capture Test</button> | ||
<button id="toggleButton" onclick="toggleStatus()">Disable</button> | ||
<div id="statusDisplay"></div> | ||
<script> function testScreenCapture() { | ||
navigator.mediaDevices.getDisplayMedia(); | ||
} | ||
|
||
function toggleStatus() { | ||
var button = document.getElementById('toggleButton'); | ||
var statusDisplay = document.getElementById('statusDisplay'); | ||
if (button.innerHTML === "Enable") { | ||
chrome.webview.postMessage("EnableScreenCapture"); | ||
button.innerHTML = "Disable"; | ||
statusDisplay.innerHTML = "Status: Enabled"; | ||
} else { | ||
chrome.webview.postMessage("DisableScreenCapture"); | ||
button.innerHTML = "Enable"; | ||
statusDisplay.innerHTML = "Status: Disabled"; | ||
} | ||
} | ||
</script> | ||
|
||
<iframe src="ScenarioScreenCaptureIFrame1.html" | ||
name="iframe-toplevel1" | ||
title="" | ||
height="300" | ||
width="1000"> </iframe> | ||
|
||
<iframe src="ScenarioScreenCaptureIFrame2.html" | ||
name="iframe-toplevel2" | ||
title="" | ||
height="300" | ||
width="1000"> </iframe> | ||
</body> | ||
</html> |
32 changes: 32 additions & 0 deletions
32
SampleApps/WebView2APISample/assets/ScenarioScreenCaptureIFrame1.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ScenarioScreenCaptureIFrame1</title> | ||
</head> | ||
<body> | ||
<h1>Screen Capture Test From Top Level IFrame1</h1> | ||
<button onclick="testScreenCapture()">Screen Capture Test</button> | ||
<button id="toggleButton" onclick="toggleStatus()">Disable</button> | ||
<div id="statusDisplay"></div> | ||
<script> | ||
function testScreenCapture() { | ||
navigator.mediaDevices.getDisplayMedia(); | ||
} | ||
|
||
function toggleStatus() { | ||
var button = document.getElementById('toggleButton'); | ||
var statusDisplay = document.getElementById('statusDisplay'); | ||
if (button.innerHTML === "Enable") { | ||
chrome.webview.postMessage("EnableScreenCapture"); | ||
button.innerHTML = "Disable"; | ||
statusDisplay.innerHTML = "Status: Enabled"; | ||
} else { | ||
chrome.webview.postMessage("DisableScreenCapture"); | ||
button.innerHTML = "Enable"; | ||
statusDisplay.innerHTML = "Status: Disabled"; | ||
} | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
32 changes: 32 additions & 0 deletions
32
SampleApps/WebView2APISample/assets/ScenarioScreenCaptureIFrame2.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ScenarioScreenCaptureIFrame2</title> | ||
</head> | ||
<body> | ||
<h1>Screen Capture Test From Top Level IFrame2</h1> | ||
<button onclick="testScreenCapture()">Screen Capture Test</button> | ||
<button id="toggleButton" onclick="toggleStatus()">Disable</button> | ||
<div id="statusDisplay"></div> | ||
<script> | ||
function testScreenCapture() { | ||
navigator.mediaDevices.getDisplayMedia(); | ||
} | ||
|
||
function toggleStatus() { | ||
var button = document.getElementById('toggleButton'); | ||
var statusDisplay = document.getElementById('statusDisplay'); | ||
if (button.innerHTML === "Enable") { | ||
chrome.webview.postMessage("EnableScreenCapture"); | ||
button.innerHTML = "Disable"; | ||
statusDisplay.innerHTML = "Status: Enabled"; | ||
} else { | ||
chrome.webview.postMessage("DisableScreenCapture"); | ||
button.innerHTML = "Enable"; | ||
statusDisplay.innerHTML = "Status: Disabled"; | ||
} | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters