Skip to content

Commit

Permalink
Wallet data files installer delegate impl for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHeaps authored and yrliou committed Nov 4, 2023
1 parent fdf1bf2 commit e3449f4
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ios/browser/application_context/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -83,4 +85,7 @@

// Start the local data file service
local_data_files_service()->Start();

brave_wallet::WalletDataFilesInstaller::GetInstance().SetDelegate(
std::make_unique<brave_wallet::WalletDataFilesInstallerDelegateImpl>());
}
2 changes: 2 additions & 0 deletions ios/browser/brave_wallet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -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_
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e3449f4

Please sign in to comment.