blob: f6a026fc5006345b47c35db46670e8f6dd4d34e0 [file] [log] [blame]
Daniel Murphyee53ac5b2023-04-14 15:16:391// Copyright 2023 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/web_applications/locks/with_app_resources.h"
6
7#include "chrome/browser/web_applications/locks/web_app_lock_manager.h"
8#include "chrome/browser/web_applications/web_app_provider.h"
9
10namespace web_app {
11
12WithAppResources::~WithAppResources() = default;
13
14WebAppRegistrar& WithAppResources::registrar() {
15 CHECK(lock_manager_);
16 return lock_manager_->provider().registrar_unsafe();
17}
18WebAppSyncBridge& WithAppResources::sync_bridge() {
19 CHECK(lock_manager_);
20 return lock_manager_->provider().sync_bridge_unsafe();
21}
22WebAppInstallFinalizer& WithAppResources::install_finalizer() {
23 CHECK(lock_manager_);
24 return lock_manager_->provider().install_finalizer();
25}
26OsIntegrationManager& WithAppResources::os_integration_manager() {
27 CHECK(lock_manager_);
28 return lock_manager_->provider().os_integration_manager();
29}
30WebAppInstallManager& WithAppResources::install_manager() {
31 CHECK(lock_manager_);
32 return lock_manager_->provider().install_manager();
33}
34WebAppIconManager& WithAppResources::icon_manager() {
35 CHECK(lock_manager_);
36 return lock_manager_->provider().icon_manager();
37}
38WebAppTranslationManager& WithAppResources::translation_manager() {
39 CHECK(lock_manager_);
40 return lock_manager_->provider().translation_manager();
41}
42WebAppUiManager& WithAppResources::ui_manager() {
43 CHECK(lock_manager_);
44 return lock_manager_->provider().ui_manager();
45}
Lu Huanged7019e92023-04-19 02:04:2246WebAppOriginAssociationManager& WithAppResources::origin_association_manager() {
47 CHECK(lock_manager_);
48 return lock_manager_->provider().origin_association_manager();
49}
Daniel Murphyee53ac5b2023-04-14 15:16:3950WithAppResources::WithAppResources(
51 base::WeakPtr<WebAppLockManager> lock_manager)
52 : lock_manager_(std::move(lock_manager)) {}
53
54} // namespace web_app