From 3898c3903e0d73be1e227e8cc109651299f3d05e Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Wed, 5 Jun 2019 12:17:31 -0400 Subject: web_browser: Use function tables for execute and initialize Allows easy handling of multiple shim types, as they have enough in common to be the same backend but not enough to share init/exec. --- src/core/hle/service/am/applets/web_browser.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/core/hle/service/am/applets/web_browser.h') diff --git a/src/core/hle/service/am/applets/web_browser.h b/src/core/hle/service/am/applets/web_browser.h index 2474675de..a3d2627f4 100644 --- a/src/core/hle/service/am/applets/web_browser.h +++ b/src/core/hle/service/am/applets/web_browser.h @@ -4,6 +4,7 @@ #pragma once +#include #include "core/file_sys/vfs_types.h" #include "core/hle/service/am/am.h" #include "core/hle/service/am/applets/applets.h" @@ -11,6 +12,7 @@ namespace Service::AM::Applets { enum class ShimKind : u32; +enum class ShopWebTarget; enum class WebArgTLVType : u16; class WebBrowser final : public Applet { @@ -35,6 +37,17 @@ public: void Finalize(); private: + void InitializeInternal(); + void ExecuteInternal(); + + // Specific initializers for the types of web applets + void InitializeShop(); + void InitializeOffline(); + + // Specific executors for the types of web applets + void ExecuteShop(); + void ExecuteOffline(); + Core::Frontend::WebBrowserApplet& frontend; bool complete = false; @@ -44,8 +57,16 @@ private: ShimKind kind; std::map> args; + FileSys::VirtualFile offline_romfs; std::string temporary_dir; std::string filename; + + ShopWebTarget shop_web_target; + std::map shop_query; + std::optional title_id = 0; + std::optional user_id; + std::optional shop_full_display; + std::string shop_extra_parameter; }; } // namespace Service::AM::Applets -- cgit v1.2.3