|
39 | 39 | #include "ScenarioExtensionsManagement.h" |
40 | 40 | #include "ScenarioIFrameDevicePermission.h" |
41 | 41 | #include "ScenarioNavigateWithWebResourceRequest.h" |
| 42 | +#include "ScenarioNotificationReceived.h" |
42 | 43 | #include "ScenarioPermissionManagement.h" |
43 | 44 | #include "ScenarioSharedBuffer.h" |
44 | 45 | #include "ScenarioSharedWorkerWRR.h" |
|
50 | 51 | #include "SettingsComponent.h" |
51 | 52 | #include "TextInputDialog.h" |
52 | 53 | #include "ViewComponent.h" |
53 | | - |
54 | 54 | using namespace Microsoft::WRL; |
55 | 55 | static constexpr size_t s_maxLoadString = 100; |
56 | 56 | static constexpr UINT s_runAsyncWindowMessage = WM_APP; |
@@ -554,6 +554,16 @@ bool AppWindow::ExecuteWebViewCommands(WPARAM wParam, LPARAM lParam) |
554 | 554 | L"CookieManagement", MB_OK); |
555 | 555 | return true; |
556 | 556 | } |
| 557 | + case IDM_SCENARIO_EXTENSIONS_MANAGEMENT_INSTALL_DEFAULT: |
| 558 | + { |
| 559 | + NewComponent<ScenarioExtensionsManagement>(this, false); |
| 560 | + return true; |
| 561 | + } |
| 562 | + case IDM_SCENARIO_EXTENSIONS_MANAGEMENT_OFFLOAD_DEFAULT: |
| 563 | + { |
| 564 | + NewComponent<ScenarioExtensionsManagement>(this, true); |
| 565 | + return true; |
| 566 | + } |
557 | 567 | case IDM_SCENARIO_CUSTOM_SCHEME: |
558 | 568 | { |
559 | 569 | NewComponent<ScenarioCustomScheme>(this); |
@@ -584,6 +594,11 @@ bool AppWindow::ExecuteWebViewCommands(WPARAM wParam, LPARAM lParam) |
584 | 594 | NewComponent<ScenarioNavigateWithWebResourceRequest>(this); |
585 | 595 | return true; |
586 | 596 | } |
| 597 | + case IDM_SCENARIO_NOTIFICATION: |
| 598 | + { |
| 599 | + NewComponent<ScenarioNotificationReceived>(this); |
| 600 | + return true; |
| 601 | + } |
587 | 602 | case IDM_SCENARIO_TESTING_FOCUS: |
588 | 603 | { |
589 | 604 | WCHAR testingFocusPath[] = L"ScenarioTestingFocus.html"; |
@@ -964,7 +979,7 @@ bool AppWindow::PrintToDefaultPrinter() |
964 | 979 | printStatus == COREWEBVIEW2_PRINT_STATUS_SUCCEEDED) |
965 | 980 | { |
966 | 981 | message = L"Printing " + std::wstring(title.get()) + |
967 | | - L" document to printer is succedded"; |
| 982 | + L" document to printer is succeeded"; |
968 | 983 | } |
969 | 984 | else if ( |
970 | 985 | errorCode == S_OK && |
@@ -1090,7 +1105,7 @@ bool AppWindow::PrintToPrinter() |
1090 | 1105 | if (errorCode == S_OK && printStatus == COREWEBVIEW2_PRINT_STATUS_SUCCEEDED) |
1091 | 1106 | { |
1092 | 1107 | message = L"Printing " + std::wstring(title.get()) + |
1093 | | - L" document to printer is succedded"; |
| 1108 | + L" document to printer is succeeded"; |
1094 | 1109 | } |
1095 | 1110 | else if ( |
1096 | 1111 | errorCode == S_OK && |
@@ -1298,6 +1313,12 @@ void AppWindow::InitializeWebView() |
1298 | 1313 | options5->put_EnableTrackingPrevention(m_TrackingPreventionEnabled ? TRUE : FALSE)); |
1299 | 1314 | } |
1300 | 1315 |
|
| 1316 | + Microsoft::WRL::ComPtr<ICoreWebView2ExperimentalEnvironmentOptions> optionsExperimental; |
| 1317 | + if (options.As(&optionsExperimental) == S_OK) |
| 1318 | + { |
| 1319 | + CHECK_FAILURE(optionsExperimental->put_AreBrowserExtensionsEnabled(TRUE)); |
| 1320 | + } |
| 1321 | + |
1301 | 1322 | HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( |
1302 | 1323 | subFolder, m_userDataFolder.c_str(), options.Get(), |
1303 | 1324 | Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( |
@@ -1353,11 +1374,11 @@ HRESULT AppWindow::OnCreateEnvironmentCompleted( |
1353 | 1374 | CHECK_FAILURE(result); |
1354 | 1375 | m_webViewEnvironment = environment; |
1355 | 1376 |
|
1356 | | - if (m_webviewOption.entry == WebViewCreateEntry::EVER_FROM_CREATE_WITH_OPTION_MENU) |
| 1377 | + if (m_webviewOption.entry == WebViewCreateEntry::EVER_FROM_CREATE_WITH_OPTION_MENU |
| 1378 | + ) |
1357 | 1379 | { |
1358 | 1380 | return CreateControllerWithOptions(); |
1359 | 1381 | } |
1360 | | - |
1361 | 1382 | auto webViewEnvironment3 = m_webViewEnvironment.try_query<ICoreWebView2Environment3>(); |
1362 | 1383 |
|
1363 | 1384 | if (webViewEnvironment3 && (m_dcompDevice || m_wincompCompositor)) |
@@ -1547,6 +1568,7 @@ HRESULT AppWindow::OnCreateCoreWebView2ControllerCompleted( |
1547 | 1568 | //! [AddVirtualHostNameToFolderMapping] |
1548 | 1569 | } |
1549 | 1570 | NewComponent<ScenarioPermissionManagement>(this); |
| 1571 | + NewComponent<ScenarioNotificationReceived>(this); |
1550 | 1572 |
|
1551 | 1573 | // We have a few of our own event handlers to register here as well |
1552 | 1574 | RegisterEventHandlers(); |
|
0 commit comments