-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for the
webRequestedEventArgs.resourceContext
property.
- Added support for the `webRequestedEventArgs.resourceContext` property. - Changed `wv2env_t` to `wv2environment_t`
- Loading branch information
Showing
15 changed files
with
218 additions
and
51 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
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
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
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
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,35 @@ | ||
#include "cwv2webResourceResponse.h" | ||
#include "cwv2types.h" | ||
|
||
cwv2webResourceResponse::cwv2webResourceResponse() { | ||
} | ||
cwv2webResourceResponse::cwv2webResourceResponse(CComPtr<ICoreWebView2WebResourceResponse> response) { | ||
setResponse(response); | ||
} | ||
|
||
void cwv2webResourceResponse::setResponse(CComPtr<ICoreWebView2WebResourceResponse> response) { | ||
response_ = response; | ||
} | ||
|
||
int32_t cwv2webResourceResponse::statusCode() { | ||
if (!response_) return 0; | ||
int32_t statusCode = 0; | ||
response_->get_StatusCode(&statusCode); | ||
return statusCode; | ||
} | ||
|
||
HRESULT cwv2webResourceResponse::setStatusCode(int32_t statusCode) { | ||
if (!response_) return E_NOINTERFACE; | ||
return response_->put_StatusCode(statusCode); | ||
} | ||
LPWSTR cwv2webResourceResponse::reasonPhrase() { | ||
if (!response_) return nullptr; | ||
return getStrVal([&](LPWSTR* value)->HRESULT { | ||
return response_->get_ReasonPhrase(value); | ||
}); | ||
} | ||
|
||
HRESULT cwv2webResourceResponse::setReasonPhrase(LPCWSTR reasonPhrase) { | ||
if (!response_) return E_NOINTERFACE; | ||
return response_->put_ReasonPhrase(reasonPhrase); | ||
} |
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,20 @@ | ||
#pragma once | ||
#include "WebView2.h" | ||
#include "wv2.h" | ||
#include <atlcomcli.h> | ||
|
||
|
||
class cwv2webResourceResponse : public wv2webResourceResponse { | ||
public: | ||
cwv2webResourceResponse(); | ||
cwv2webResourceResponse(CComPtr<ICoreWebView2WebResourceResponse> response); | ||
|
||
void setResponse(CComPtr<ICoreWebView2WebResourceResponse> response); | ||
int32_t statusCode() override; | ||
HRESULT setStatusCode(int32_t statusCode) override; | ||
LPWSTR reasonPhrase() override; | ||
HRESULT setReasonPhrase(LPCWSTR reasonPhrase) override; | ||
|
||
private: | ||
CComPtr<ICoreWebView2WebResourceResponse> response_; | ||
}; |
Oops, something went wrong.