summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-12-06 00:46:57 +0100
committerLioncash <mathew1800@gmail.com>2022-12-06 01:06:04 +0100
commite26c86a6e78f00ce6641fc65e7076cacc91e2137 (patch)
tree97bd3cd0380855f3931f28694ea19197e4611f79 /src/core
parentapplets/software_keyboard: Use aliases for callbacks (diff)
downloadyuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.tar
yuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.tar.gz
yuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.tar.bz2
yuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.tar.lz
yuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.tar.xz
yuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.tar.zst
yuzu-e26c86a6e78f00ce6641fc65e7076cacc91e2137.zip
Diffstat (limited to '')
-rw-r--r--src/core/frontend/applets/web_browser.cpp11
-rw-r--r--src/core/frontend/applets/web_browser.h24
2 files changed, 17 insertions, 18 deletions
diff --git a/src/core/frontend/applets/web_browser.cpp b/src/core/frontend/applets/web_browser.cpp
index 27c7086be..b09cb7102 100644
--- a/src/core/frontend/applets/web_browser.cpp
+++ b/src/core/frontend/applets/web_browser.cpp
@@ -10,18 +10,17 @@ WebBrowserApplet::~WebBrowserApplet() = default;
DefaultWebBrowserApplet::~DefaultWebBrowserApplet() = default;
-void DefaultWebBrowserApplet::OpenLocalWebPage(
- const std::string& local_url, std::function<void()> extract_romfs_callback,
- std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const {
+void DefaultWebBrowserApplet::OpenLocalWebPage(const std::string& local_url,
+ ExtractROMFSCallback extract_romfs_callback,
+ OpenWebPageCallback callback) const {
LOG_WARNING(Service_AM, "(STUBBED) called, backend requested to open local web page at {}",
local_url);
callback(Service::AM::Applets::WebExitReason::WindowClosed, "http://localhost/");
}
-void DefaultWebBrowserApplet::OpenExternalWebPage(
- const std::string& external_url,
- std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const {
+void DefaultWebBrowserApplet::OpenExternalWebPage(const std::string& external_url,
+ OpenWebPageCallback callback) const {
LOG_WARNING(Service_AM, "(STUBBED) called, backend requested to open external web page at {}",
external_url);
diff --git a/src/core/frontend/applets/web_browser.h b/src/core/frontend/applets/web_browser.h
index 1411274f8..4f72284ad 100644
--- a/src/core/frontend/applets/web_browser.h
+++ b/src/core/frontend/applets/web_browser.h
@@ -11,29 +11,29 @@ namespace Core::Frontend {
class WebBrowserApplet {
public:
+ using ExtractROMFSCallback = std::function<void()>;
+ using OpenWebPageCallback =
+ std::function<void(Service::AM::Applets::WebExitReason, std::string)>;
+
virtual ~WebBrowserApplet();
- virtual void OpenLocalWebPage(
- const std::string& local_url, std::function<void()> extract_romfs_callback,
- std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
+ virtual void OpenLocalWebPage(const std::string& local_url,
+ ExtractROMFSCallback extract_romfs_callback,
+ OpenWebPageCallback callback) const = 0;
- virtual void OpenExternalWebPage(
- const std::string& external_url,
- std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0;
+ virtual void OpenExternalWebPage(const std::string& external_url,
+ OpenWebPageCallback callback) const = 0;
};
class DefaultWebBrowserApplet final : public WebBrowserApplet {
public:
~DefaultWebBrowserApplet() override;
- void OpenLocalWebPage(const std::string& local_url,
- std::function<void()> extract_romfs_callback,
- std::function<void(Service::AM::Applets::WebExitReason, std::string)>
- callback) const override;
+ void OpenLocalWebPage(const std::string& local_url, ExtractROMFSCallback extract_romfs_callback,
+ OpenWebPageCallback callback) const override;
void OpenExternalWebPage(const std::string& external_url,
- std::function<void(Service::AM::Applets::WebExitReason, std::string)>
- callback) const override;
+ OpenWebPageCallback callback) const override;
};
} // namespace Core::Frontend