diff options
Diffstat (limited to 'src/core/hle/service/am/applets')
-rw-r--r-- | src/core/hle/service/am/applets/applets.cpp | 21 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applets.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/web_browser.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/web_browser.h | 4 |
4 files changed, 20 insertions, 14 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index 553206177..6bdba2468 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -139,12 +139,14 @@ void Applet::Initialize() { AppletFrontendSet::AppletFrontendSet() = default; -AppletFrontendSet::AppletFrontendSet(ErrorApplet error, PhotoViewer photo_viewer, - ProfileSelect profile_select, - SoftwareKeyboard software_keyboard, WebBrowser web_browser) - : error{std::move(error)}, photo_viewer{std::move(photo_viewer)}, profile_select{std::move( - profile_select)}, - software_keyboard{std::move(software_keyboard)}, web_browser{std::move(web_browser)} {} +AppletFrontendSet::AppletFrontendSet(ParentalControlsApplet parental_controls, ErrorApplet error, + PhotoViewer photo_viewer, ProfileSelect profile_select, + SoftwareKeyboard software_keyboard, WebBrowser web_browser, + ECommerceApplet e_commerce) + : parental_controls{std::move(parental_controls)}, error{std::move(error)}, + photo_viewer{std::move(photo_viewer)}, profile_select{std::move(profile_select)}, + software_keyboard{std::move(software_keyboard)}, web_browser{std::move(web_browser)}, + e_commerce{std::move(e_commerce)} {} AppletFrontendSet::~AppletFrontendSet() = default; @@ -214,7 +216,7 @@ void AppletManager::ClearAll() { frontend = {}; } -std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { +std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id, u64 current_process_title_id) const { switch (id) { case AppletId::Auth: return std::make_shared<Auth>(*frontend.parental_controls); @@ -227,9 +229,10 @@ std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { case AppletId::PhotoViewer: return std::make_shared<PhotoViewer>(*frontend.photo_viewer); case AppletId::LibAppletShop: - return std::make_shared<WebBrowser>(*frontend.web_browser, frontend.e_commerce.get()); + return std::make_shared<WebBrowser>(*frontend.web_browser, current_process_title_id, + frontend.e_commerce.get()); case AppletId::LibAppletOff: - return std::make_shared<WebBrowser>(*frontend.web_browser); + return std::make_shared<WebBrowser>(*frontend.web_browser, current_process_title_id); default: UNIMPLEMENTED_MSG( "No backend implementation exists for applet_id={:02X}! Falling back to stub applet.", diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index ef3791865..adc973dad 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -187,7 +187,7 @@ public: void SetDefaultAppletsIfMissing(); void ClearAll(); - std::shared_ptr<Applet> GetApplet(AppletId id) const; + std::shared_ptr<Applet> GetApplet(AppletId id, u64 current_process_title_id) const; private: AppletFrontendSet frontend; diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp index 3aa8f2468..2762e0653 100644 --- a/src/core/hle/service/am/applets/web_browser.cpp +++ b/src/core/hle/service/am/applets/web_browser.cpp @@ -207,9 +207,10 @@ FileSys::VirtualFile GetApplicationRomFS(u64 title_id, FileSys::ContentRecordTyp } // Anonymous namespace -WebBrowser::WebBrowser(Core::Frontend::WebBrowserApplet& frontend, +WebBrowser::WebBrowser(Core::Frontend::WebBrowserApplet& frontend, u64 current_process_title_id, Core::Frontend::ECommerceApplet* frontend_e_commerce) - : frontend(frontend), frontend_e_commerce(frontend_e_commerce) {} + : frontend(frontend), frontend_e_commerce(frontend_e_commerce), + current_process_title_id(current_process_title_id) {} WebBrowser::~WebBrowser() = default; @@ -469,7 +470,7 @@ void WebBrowser::InitializeOffline() { } if (title_id == 0) { - title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); + title_id = current_process_title_id; } offline_romfs = GetApplicationRomFS(title_id, type); diff --git a/src/core/hle/service/am/applets/web_browser.h b/src/core/hle/service/am/applets/web_browser.h index 9667dcf6f..870f57b64 100644 --- a/src/core/hle/service/am/applets/web_browser.h +++ b/src/core/hle/service/am/applets/web_browser.h @@ -17,7 +17,7 @@ enum class WebArgTLVType : u16; class WebBrowser final : public Applet { public: - WebBrowser(Core::Frontend::WebBrowserApplet& frontend, + WebBrowser(Core::Frontend::WebBrowserApplet& frontend, u64 current_process_title_id, Core::Frontend::ECommerceApplet* frontend_e_commerce = nullptr); ~WebBrowser() override; @@ -59,6 +59,8 @@ private: bool unpacked = false; ResultCode status = RESULT_SUCCESS; + u64 current_process_title_id; + ShimKind kind; std::map<WebArgTLVType, std::vector<u8>> args; |