diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-06-05 18:13:59 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-06-25 02:05:11 +0200 |
commit | e447d8aafa4e49bbd7a06945b4653bc43141f423 (patch) | |
tree | 49e68f0d98ebdb86dac6950870fb01be9d387519 /src/core/hle/service | |
parent | web_browser: Rename OpenPage to OpenPageLocal (diff) | |
download | yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.gz yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.bz2 yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.lz yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.xz yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.zst yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/applets/applets.cpp | 24 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applets.h | 12 |
2 files changed, 29 insertions, 7 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index e3e4ead03..553206177 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -157,6 +157,8 @@ AppletManager::AppletManager() = default; AppletManager::~AppletManager() = default; void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) { + if (set.parental_controls != nullptr) + frontend.parental_controls = std::move(set.parental_controls); if (set.error != nullptr) frontend.error = std::move(set.error); if (set.photo_viewer != nullptr) @@ -167,17 +169,21 @@ void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) { frontend.software_keyboard = std::move(set.software_keyboard); if (set.web_browser != nullptr) frontend.web_browser = std::move(set.web_browser); + if (set.e_commerce != nullptr) + frontend.e_commerce = std::move(set.e_commerce); } void AppletManager::SetDefaultAppletFrontendSet() { - frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>(); - frontend.photo_viewer = std::make_unique<Core::Frontend::DefaultPhotoViewerApplet>(); - frontend.profile_select = std::make_unique<Core::Frontend::DefaultProfileSelectApplet>(); - frontend.software_keyboard = std::make_unique<Core::Frontend::DefaultSoftwareKeyboardApplet>(); - frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>(); + ClearAll(); + SetDefaultAppletsIfMissing(); } void AppletManager::SetDefaultAppletsIfMissing() { + if (frontend.parental_controls == nullptr) { + frontend.parental_controls = + std::make_unique<Core::Frontend::DefaultParentalControlsApplet>(); + } + if (frontend.error == nullptr) { frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>(); } @@ -198,6 +204,10 @@ void AppletManager::SetDefaultAppletsIfMissing() { if (frontend.web_browser == nullptr) { frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>(); } + + if (frontend.e_commerce == nullptr) { + frontend.e_commerce = std::make_unique<Core::Frontend::DefaultECommerceApplet>(); + } } void AppletManager::ClearAll() { @@ -206,6 +216,8 @@ void AppletManager::ClearAll() { std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { switch (id) { + case AppletId::Auth: + return std::make_shared<Auth>(*frontend.parental_controls); case AppletId::Error: return std::make_shared<Error>(*frontend.error); case AppletId::ProfileSelect: @@ -214,6 +226,8 @@ std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { return std::make_shared<SoftwareKeyboard>(*frontend.software_keyboard); 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()); case AppletId::LibAppletOff: return std::make_shared<WebBrowser>(*frontend.web_browser); default: diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 05ae739ca..ef3791865 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -13,7 +13,9 @@ union ResultCode; namespace Core::Frontend { +class ECommerceApplet; class ErrorApplet; +class ParentalControlsApplet; class PhotoViewerApplet; class ProfileSelectApplet; class SoftwareKeyboardApplet; @@ -145,15 +147,19 @@ protected: }; struct AppletFrontendSet { + using ParentalControlsApplet = std::unique_ptr<Core::Frontend::ParentalControlsApplet>; using ErrorApplet = std::unique_ptr<Core::Frontend::ErrorApplet>; using PhotoViewer = std::unique_ptr<Core::Frontend::PhotoViewerApplet>; using ProfileSelect = std::unique_ptr<Core::Frontend::ProfileSelectApplet>; using SoftwareKeyboard = std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet>; using WebBrowser = std::unique_ptr<Core::Frontend::WebBrowserApplet>; + using ECommerceApplet = std::unique_ptr<Core::Frontend::ECommerceApplet>; AppletFrontendSet(); - AppletFrontendSet(ErrorApplet error, PhotoViewer photo_viewer, ProfileSelect profile_select, - SoftwareKeyboard software_keyboard, WebBrowser web_browser); + AppletFrontendSet(ParentalControlsApplet parental_controls, ErrorApplet error, + PhotoViewer photo_viewer, ProfileSelect profile_select, + SoftwareKeyboard software_keyboard, WebBrowser web_browser, + ECommerceApplet e_commerce); ~AppletFrontendSet(); AppletFrontendSet(const AppletFrontendSet&) = delete; @@ -162,11 +168,13 @@ struct AppletFrontendSet { AppletFrontendSet(AppletFrontendSet&&) noexcept; AppletFrontendSet& operator=(AppletFrontendSet&&) noexcept; + ParentalControlsApplet parental_controls; ErrorApplet error; PhotoViewer photo_viewer; ProfileSelect profile_select; SoftwareKeyboard software_keyboard; WebBrowser web_browser; + ECommerceApplet e_commerce; }; class AppletManager { |