summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/frontend/applets/web_browser.cpp8
-rw-r--r--src/core/frontend/applets/web_browser.h12
-rw-r--r--src/core/hle/service/am/applets/web_browser.cpp5
3 files changed, 24 insertions, 1 deletions
diff --git a/src/core/frontend/applets/web_browser.cpp b/src/core/frontend/applets/web_browser.cpp
index 58861809e..0e1612e27 100644
--- a/src/core/frontend/applets/web_browser.cpp
+++ b/src/core/frontend/applets/web_browser.cpp
@@ -11,4 +11,12 @@ WebBrowserApplet::~WebBrowserApplet() = default;
DefaultWebBrowserApplet::~DefaultWebBrowserApplet() = default;
+void DefaultWebBrowserApplet::OpenLocalWebPage(
+ std::string_view local_url, std::function<void(WebExitReason, std::string)> callback) const {
+ LOG_WARNING(Service_AM, "(STUBBED) called, backend requested to open local web page at {}",
+ local_url);
+
+ callback(WebExitReason::WindowClosed, "http://localhost/");
+}
+
} // namespace Core::Frontend
diff --git a/src/core/frontend/applets/web_browser.h b/src/core/frontend/applets/web_browser.h
index 6e5f4d93d..2ccefc68f 100644
--- a/src/core/frontend/applets/web_browser.h
+++ b/src/core/frontend/applets/web_browser.h
@@ -5,17 +5,29 @@
#pragma once
#include <functional>
+#include <string_view>
+
+#include "core/hle/service/am/applets/web_types.h"
+
+using namespace Service::AM::Applets;
namespace Core::Frontend {
class WebBrowserApplet {
public:
virtual ~WebBrowserApplet();
+
+ virtual void OpenLocalWebPage(
+ std::string_view local_url,
+ std::function<void(WebExitReason, std::string)> callback) const = 0;
};
class DefaultWebBrowserApplet final : public WebBrowserApplet {
public:
~DefaultWebBrowserApplet() override;
+
+ void OpenLocalWebPage(std::string_view local_url,
+ std::function<void(WebExitReason, std::string)> callback) const override;
};
} // namespace Core::Frontend
diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp
index 06fcf3e3f..c0c98ad30 100644
--- a/src/core/hle/service/am/applets/web_browser.cpp
+++ b/src/core/hle/service/am/applets/web_browser.cpp
@@ -356,7 +356,10 @@ void WebBrowser::ExecuteLogin() {
void WebBrowser::ExecuteOffline() {
LOG_INFO(Service_AM, "Opening offline document at {}", offline_document);
- WebBrowserExit(WebExitReason::WindowClosed);
+ frontend.OpenLocalWebPage(offline_document,
+ [this](WebExitReason exit_reason, std::string last_url) {
+ WebBrowserExit(exit_reason, last_url);
+ });
}
void WebBrowser::ExecuteShare() {