summaryrefslogtreecommitdiff
path: root/src/yuzu/applets/web_browser.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-12-28 18:20:29 -0500
committerZach Hilman <zachhilman@gmail.com>2018-12-28 18:20:29 -0500
commitcb930c4b5a3f8f3931ba93ef35d4000558ffa79e (patch)
treeb897717a33fc0ba28134be25a9ba52e84b21d122 /src/yuzu/applets/web_browser.cpp
parentef4c4e239da8e5771f61bf079eae25b28cbd0318 (diff)
web_browser: Add bounds checking to applet interface
Diffstat (limited to 'src/yuzu/applets/web_browser.cpp')
-rw-r--r--src/yuzu/applets/web_browser.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/yuzu/applets/web_browser.cpp b/src/yuzu/applets/web_browser.cpp
index e1a34bb5f..c59b7ade1 100644
--- a/src/yuzu/applets/web_browser.cpp
+++ b/src/yuzu/applets/web_browser.cpp
@@ -10,15 +10,17 @@
#include "yuzu/applets/web_browser.h"
#include "yuzu/main.h"
+#ifdef YUZU_USE_QT_WEB_ENGINE
+
constexpr char NX_SHIM_INJECT_SCRIPT[] = R"(
window.nx = {};
window.nx.playReport = {};
window.nx.playReport.setCounterSetIdentifier = function () {
- console.log("nx.footer.setCounterSetIdentifier called - unimplemented");
+ console.log("nx.playReport.setCounterSetIdentifier called - unimplemented");
};
window.nx.playReport.incrementCounter = function () {
- console.log("nx.footer.incrementCounter called - unimplemented");
+ console.log("nx.playReport.incrementCounter called - unimplemented");
};
window.nx.footer = {};
@@ -56,6 +58,12 @@ constexpr char NX_SHIM_INJECT_SCRIPT[] = R"(
};
)";
+QString GetNXShimInjectionScript() {
+ return QString::fromStdString(NX_SHIM_INJECT_SCRIPT);
+}
+
+NXInputWebEngineView::NXInputWebEngineView(QWidget* parent) : QWebEngineView(parent) {}
+
void NXInputWebEngineView::keyPressEvent(QKeyEvent* event) {
parent()->event(event);
}
@@ -64,11 +72,7 @@ void NXInputWebEngineView::keyReleaseEvent(QKeyEvent* event) {
parent()->event(event);
}
-QString GetNXShimInjectionScript() {
- return QString::fromStdString(NX_SHIM_INJECT_SCRIPT);
-}
-
-NXInputWebEngineView::NXInputWebEngineView(QWidget* parent) : QWebEngineView(parent) {}
+#endif
QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {
connect(this, &QtWebBrowser::MainWindowOpenPage, &main_window, &GMainWindow::WebBrowserOpenPage,