Skip to content

Commit 4146206

Browse files
changed string comparison for C++ sample, changed language around enabling feature based on domain
1 parent 94b2fad commit 4146206

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

specs/IsNonClientRegionSupportEnabled.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ When set to `FALSE`, then all non-client region support will be disabled.
3131

3232
# Examples
3333
This example enables non-client region support for all pages on www.microsoft.com.
34-
Pages on other origins will not be trusted to use this feature.
34+
Pages on other origins will not have non-client region support enabled.
3535

3636
## Win32 C++
3737
```cpp
@@ -56,19 +56,9 @@ ScenarioNonClientRegionSupport::ScenarioNonClientRegionSupport(AppWindow* appWin
5656
coreWebView2Settings12 = m_settings.try_query<ICoreWebView2Settings12();
5757
CHECK_FEATURE_RETURN(coreWebView2Settings12);
5858

59-
BOOL enabled;
60-
CHECK_FAILURE(coreWebView2Settings12->get_IsNonClientRegionSupportEnabled(&enabled));
61-
62-
if (wcscmp(domain.get(), allowedHostName) == 0 && !enabled)
63-
{
64-
CHECK_FAILURE(
65-
coreWebView2Settings12->put_IsNonClientRegionSupportEnabled(TRUE));
66-
}
67-
else if (wcscmp(domain.get(), allowedHostName) != 0 && enabled)
68-
{
69-
CHECK_FAILURE(
70-
coreWebView2Settings12->put_IsNonClientRegionSupportEnabled(FALSE));
71-
}
59+
bool trusted = _wcsicmp(domain.get(), allowedHostName) == 0;
60+
CHECK_FAILURE(coreWebView2Settings12->put_IsNonClientRegionSupportEnabled(trusted));
61+
7262
return S_OK;
7363
})
7464
.Get(),

0 commit comments

Comments
 (0)