diff --git a/ios/browser/application_context/BUILD.gn b/ios/browser/application_context/BUILD.gn index d9c4c79ed555..69dc5a0b5b6e 100644 --- a/ios/browser/application_context/BUILD.gn +++ b/ios/browser/application_context/BUILD.gn @@ -14,7 +14,9 @@ source_set("application_context") { deps = [ "//base", "//brave/components/brave_component_updater/browser", + "//brave/components/brave_wallet/browser", "//brave/components/url_sanitizer/browser", + "//brave/ios/browser/brave_wallet", "//ios/chrome/browser/application_context/model", "//ios/chrome/browser/shared/model/application_context", ] diff --git a/ios/browser/application_context/brave_application_context_impl.mm b/ios/browser/application_context/brave_application_context_impl.mm index 9b17cd0460a7..ba5ad0c0cb7a 100644 --- a/ios/browser/application_context/brave_application_context_impl.mm +++ b/ios/browser/application_context/brave_application_context_impl.mm @@ -12,7 +12,9 @@ #include "brave/components/brave_component_updater/browser/brave_component.h" #include "brave/components/brave_component_updater/browser/brave_component_updater_delegate.h" #include "brave/components/brave_component_updater/browser/local_data_files_service.h" +#include "brave/components/brave_wallet/browser/wallet_data_files_installer.h" #include "brave/components/url_sanitizer/browser/url_sanitizer_component_installer.h" +#include "brave/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.h" #include "ios/chrome/browser/shared/model/application_context/application_context.h" BraveApplicationContextImpl::BraveApplicationContextImpl( @@ -83,4 +85,7 @@ // Start the local data file service local_data_files_service()->Start(); + + brave_wallet::WalletDataFilesInstaller::GetInstance().SetDelegate( + std::make_unique()); } diff --git a/ios/browser/brave_wallet/BUILD.gn b/ios/browser/brave_wallet/BUILD.gn index 8066650d4b6a..207ead1e9186 100644 --- a/ios/browser/brave_wallet/BUILD.gn +++ b/ios/browser/brave_wallet/BUILD.gn @@ -21,6 +21,8 @@ source_set("brave_wallet") { "swap_service_factory.h", "tx_service_factory.cc", "tx_service_factory.h", + "wallet_data_files_installer_delegate_impl.h", + "wallet_data_files_installer_delegate_impl.mm", "zcash_wallet_service_factory.h", "zcash_wallet_service_factory.mm", ] diff --git a/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.h b/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.h new file mode 100644 index 000000000000..0701d70a9779 --- /dev/null +++ b/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_IOS_BROWSER_BRAVE_WALLET_WALLET_DATA_FILES_INSTALLER_DELEGATE_IMPL_H_ +#define BRAVE_IOS_BROWSER_BRAVE_WALLET_WALLET_DATA_FILES_INSTALLER_DELEGATE_IMPL_H_ + +#include "brave/components/brave_wallet/browser/wallet_data_files_installer_delegate.h" + +namespace brave_wallet { + +class WalletDataFilesInstallerDelegateImpl + : public WalletDataFilesInstallerDelegate { + public: + WalletDataFilesInstallerDelegateImpl() = default; + ~WalletDataFilesInstallerDelegateImpl() override = default; + component_updater::ComponentUpdateService* GetComponentUpdater() override; +}; + +} // namespace brave_wallet + +#endif // BRAVE_IOS_BROWSER_BRAVE_WALLET_WALLET_DATA_FILES_INSTALLER_DELEGATE_IMPL_H_ diff --git a/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.mm b/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.mm new file mode 100644 index 000000000000..f8e482ef6686 --- /dev/null +++ b/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.mm @@ -0,0 +1,16 @@ +/* Copyright (c) 2023 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "brave/ios/browser/brave_wallet/wallet_data_files_installer_delegate_impl.h" +#include "ios/chrome/browser/shared/model/application_context/application_context.h" + +namespace brave_wallet { + +component_updater::ComponentUpdateService* +WalletDataFilesInstallerDelegateImpl::GetComponentUpdater() { + return GetApplicationContext()->GetComponentUpdateService(); +} + +} // namespace brave_wallet