diff options
| author | 2019-06-05 12:13:59 -0400 | |
|---|---|---|
| committer | 2019-06-24 20:05:11 -0400 | |
| commit | e447d8aafa4e49bbd7a06945b4653bc43141f423 (patch) | |
| tree | 49e68f0d98ebdb86dac6950870fb01be9d387519 /src/core | |
| parent | web_browser: Rename OpenPage to OpenPageLocal (diff) | |
| download | yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.gz yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.tar.xz yuzu-e447d8aafa4e49bbd7a06945b4653bc43141f423.zip | |
applets: Track ECommerce and Parental Control applet frontends
Diffstat (limited to 'src/core')
| -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; | |||
| 157 | AppletManager::~AppletManager() = default; | 157 | AppletManager::~AppletManager() = default; |
| 158 | 158 | ||
| 159 | void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) { | 159 | void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) { |
| 160 | if (set.parental_controls != nullptr) | ||
| 161 | frontend.parental_controls = std::move(set.parental_controls); | ||
| 160 | if (set.error != nullptr) | 162 | if (set.error != nullptr) |
| 161 | frontend.error = std::move(set.error); | 163 | frontend.error = std::move(set.error); |
| 162 | if (set.photo_viewer != nullptr) | 164 | if (set.photo_viewer != nullptr) |
| @@ -167,17 +169,21 @@ void AppletManager::SetAppletFrontendSet(AppletFrontendSet set) { | |||
| 167 | frontend.software_keyboard = std::move(set.software_keyboard); | 169 | frontend.software_keyboard = std::move(set.software_keyboard); |
| 168 | if (set.web_browser != nullptr) | 170 | if (set.web_browser != nullptr) |
| 169 | frontend.web_browser = std::move(set.web_browser); | 171 | frontend.web_browser = std::move(set.web_browser); |
| 172 | if (set.e_commerce != nullptr) | ||
| 173 | frontend.e_commerce = std::move(set.e_commerce); | ||
| 170 | } | 174 | } |
| 171 | 175 | ||
| 172 | void AppletManager::SetDefaultAppletFrontendSet() { | 176 | void AppletManager::SetDefaultAppletFrontendSet() { |
| 173 | frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>(); | 177 | ClearAll(); |
| 174 | frontend.photo_viewer = std::make_unique<Core::Frontend::DefaultPhotoViewerApplet>(); | 178 | SetDefaultAppletsIfMissing(); |
| 175 | frontend.profile_select = std::make_unique<Core::Frontend::DefaultProfileSelectApplet>(); | ||
| 176 | frontend.software_keyboard = std::make_unique<Core::Frontend::DefaultSoftwareKeyboardApplet>(); | ||
| 177 | frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>(); | ||
| 178 | } | 179 | } |
| 179 | 180 | ||
| 180 | void AppletManager::SetDefaultAppletsIfMissing() { | 181 | void AppletManager::SetDefaultAppletsIfMissing() { |
| 182 | if (frontend.parental_controls == nullptr) { | ||
| 183 | frontend.parental_controls = | ||
| 184 | std::make_unique<Core::Frontend::DefaultParentalControlsApplet>(); | ||
| 185 | } | ||
| 186 | |||
| 181 | if (frontend.error == nullptr) { | 187 | if (frontend.error == nullptr) { |
| 182 | frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>(); | 188 | frontend.error = std::make_unique<Core::Frontend::DefaultErrorApplet>(); |
| 183 | } | 189 | } |
| @@ -198,6 +204,10 @@ void AppletManager::SetDefaultAppletsIfMissing() { | |||
| 198 | if (frontend.web_browser == nullptr) { | 204 | if (frontend.web_browser == nullptr) { |
| 199 | frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>(); | 205 | frontend.web_browser = std::make_unique<Core::Frontend::DefaultWebBrowserApplet>(); |
| 200 | } | 206 | } |
| 207 | |||
| 208 | if (frontend.e_commerce == nullptr) { | ||
| 209 | frontend.e_commerce = std::make_unique<Core::Frontend::DefaultECommerceApplet>(); | ||
| 210 | } | ||
| 201 | } | 211 | } |
| 202 | 212 | ||
| 203 | void AppletManager::ClearAll() { | 213 | void AppletManager::ClearAll() { |
| @@ -206,6 +216,8 @@ void AppletManager::ClearAll() { | |||
| 206 | 216 | ||
| 207 | std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { | 217 | std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { |
| 208 | switch (id) { | 218 | switch (id) { |
| 219 | case AppletId::Auth: | ||
| 220 | return std::make_shared<Auth>(*frontend.parental_controls); | ||
| 209 | case AppletId::Error: | 221 | case AppletId::Error: |
| 210 | return std::make_shared<Error>(*frontend.error); | 222 | return std::make_shared<Error>(*frontend.error); |
| 211 | case AppletId::ProfileSelect: | 223 | case AppletId::ProfileSelect: |
| @@ -214,6 +226,8 @@ std::shared_ptr<Applet> AppletManager::GetApplet(AppletId id) const { | |||
| 214 | return std::make_shared<SoftwareKeyboard>(*frontend.software_keyboard); | 226 | return std::make_shared<SoftwareKeyboard>(*frontend.software_keyboard); |
| 215 | case AppletId::PhotoViewer: | 227 | case AppletId::PhotoViewer: |
| 216 | return std::make_shared<PhotoViewer>(*frontend.photo_viewer); | 228 | return std::make_shared<PhotoViewer>(*frontend.photo_viewer); |
| 229 | case AppletId::LibAppletShop: | ||
| 230 | return std::make_shared<WebBrowser>(*frontend.web_browser, frontend.e_commerce.get()); | ||
| 217 | case AppletId::LibAppletOff: | 231 | case AppletId::LibAppletOff: |
| 218 | return std::make_shared<WebBrowser>(*frontend.web_browser); | 232 | return std::make_shared<WebBrowser>(*frontend.web_browser); |
| 219 | default: | 233 | 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 @@ | |||
| 13 | union ResultCode; | 13 | union ResultCode; |
| 14 | 14 | ||
| 15 | namespace Core::Frontend { | 15 | namespace Core::Frontend { |
| 16 | class ECommerceApplet; | ||
| 16 | class ErrorApplet; | 17 | class ErrorApplet; |
| 18 | class ParentalControlsApplet; | ||
| 17 | class PhotoViewerApplet; | 19 | class PhotoViewerApplet; |
| 18 | class ProfileSelectApplet; | 20 | class ProfileSelectApplet; |
| 19 | class SoftwareKeyboardApplet; | 21 | class SoftwareKeyboardApplet; |
| @@ -145,15 +147,19 @@ protected: | |||
| 145 | }; | 147 | }; |
| 146 | 148 | ||
| 147 | struct AppletFrontendSet { | 149 | struct AppletFrontendSet { |
| 150 | using ParentalControlsApplet = std::unique_ptr<Core::Frontend::ParentalControlsApplet>; | ||
| 148 | using ErrorApplet = std::unique_ptr<Core::Frontend::ErrorApplet>; | 151 | using ErrorApplet = std::unique_ptr<Core::Frontend::ErrorApplet>; |
| 149 | using PhotoViewer = std::unique_ptr<Core::Frontend::PhotoViewerApplet>; | 152 | using PhotoViewer = std::unique_ptr<Core::Frontend::PhotoViewerApplet>; |
| 150 | using ProfileSelect = std::unique_ptr<Core::Frontend::ProfileSelectApplet>; | 153 | using ProfileSelect = std::unique_ptr<Core::Frontend::ProfileSelectApplet>; |
| 151 | using SoftwareKeyboard = std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet>; | 154 | using SoftwareKeyboard = std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet>; |
| 152 | using WebBrowser = std::unique_ptr<Core::Frontend::WebBrowserApplet>; | 155 | using WebBrowser = std::unique_ptr<Core::Frontend::WebBrowserApplet>; |
| 156 | using ECommerceApplet = std::unique_ptr<Core::Frontend::ECommerceApplet>; | ||
| 153 | 157 | ||
| 154 | AppletFrontendSet(); | 158 | AppletFrontendSet(); |
| 155 | AppletFrontendSet(ErrorApplet error, PhotoViewer photo_viewer, ProfileSelect profile_select, | 159 | AppletFrontendSet(ParentalControlsApplet parental_controls, ErrorApplet error, |
| 156 | SoftwareKeyboard software_keyboard, WebBrowser web_browser); | 160 | PhotoViewer photo_viewer, ProfileSelect profile_select, |
| 161 | SoftwareKeyboard software_keyboard, WebBrowser web_browser, | ||
| 162 | ECommerceApplet e_commerce); | ||
| 157 | ~AppletFrontendSet(); | 163 | ~AppletFrontendSet(); |
| 158 | 164 | ||
| 159 | AppletFrontendSet(const AppletFrontendSet&) = delete; | 165 | AppletFrontendSet(const AppletFrontendSet&) = delete; |
| @@ -162,11 +168,13 @@ struct AppletFrontendSet { | |||
| 162 | AppletFrontendSet(AppletFrontendSet&&) noexcept; | 168 | AppletFrontendSet(AppletFrontendSet&&) noexcept; |
| 163 | AppletFrontendSet& operator=(AppletFrontendSet&&) noexcept; | 169 | AppletFrontendSet& operator=(AppletFrontendSet&&) noexcept; |
| 164 | 170 | ||
| 171 | ParentalControlsApplet parental_controls; | ||
| 165 | ErrorApplet error; | 172 | ErrorApplet error; |
| 166 | PhotoViewer photo_viewer; | 173 | PhotoViewer photo_viewer; |
| 167 | ProfileSelect profile_select; | 174 | ProfileSelect profile_select; |
| 168 | SoftwareKeyboard software_keyboard; | 175 | SoftwareKeyboard software_keyboard; |
| 169 | WebBrowser web_browser; | 176 | WebBrowser web_browser; |
| 177 | ECommerceApplet e_commerce; | ||
| 170 | }; | 178 | }; |
| 171 | 179 | ||
| 172 | class AppletManager { | 180 | class AppletManager { |