1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_OS_SETTINGS_SECTIONS_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_OS_SETTINGS_SECTIONS_H_
7 
8 #include <unordered_map>
9 #include <vector>
10 
11 #include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h"
12 #include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
13 
14 class ArcAppListPrefs;
15 class Profile;
16 class SupervisedUserService;
17 
18 namespace signin {
19 class IdentityManager;
20 }  // namespace signin
21 
22 namespace syncer {
23 class SyncService;
24 }  // namespace syncer
25 
26 namespace chromeos {
27 
28 class CupsPrintersManager;
29 class KerberosCredentialsManager;
30 
31 namespace android_sms {
32 class AndroidSmsService;
33 }  // namespace android_sms
34 
35 namespace multidevice_setup {
36 class MultiDeviceSetupClient;
37 }  // namespace multidevice_setup
38 
39 namespace phonehub {
40 class PhoneHubManager;
41 }  // namespace phonehub
42 
43 namespace settings {
44 
45 // Collection of all OsSettingsSection implementations.
46 class OsSettingsSections {
47  public:
48   OsSettingsSections(
49       Profile* profile,
50       SearchTagRegistry* search_tag_registry,
51       multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
52       phonehub::PhoneHubManager* phone_hub_manager,
53       syncer::SyncService* sync_service,
54       SupervisedUserService* supervised_user_service,
55       KerberosCredentialsManager* kerberos_credentials_manager,
56       ArcAppListPrefs* arc_app_list_prefs,
57       signin::IdentityManager* identity_manager,
58       android_sms::AndroidSmsService* android_sms_service,
59       CupsPrintersManager* printers_manager);
60   OsSettingsSections(const OsSettingsSections& other) = delete;
61   OsSettingsSections& operator=(const OsSettingsSections& other) = delete;
62   virtual ~OsSettingsSections();
63 
64   const OsSettingsSection* GetSection(mojom::Section section) const;
65 
sections()66   std::vector<std::unique_ptr<OsSettingsSection>>& sections() {
67     return sections_;
68   }
69 
70  protected:
71   // Used by tests.
72   OsSettingsSections();
73 
74   std::unordered_map<mojom::Section, OsSettingsSection*> sections_map_;
75   std::vector<std::unique_ptr<OsSettingsSection>> sections_;
76 };
77 
78 }  // namespace settings
79 }  // namespace chromeos
80 
81 #endif  // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_OS_SETTINGS_SECTIONS_H_
82