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_ABOUT_SECTION_H_
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ABOUT_SECTION_H_
7 
8 #include "base/values.h"
9 #include "build/branding_buildflags.h"
10 #include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
11 #include "components/prefs/pref_change_registrar.h"
12 
13 namespace content {
14 class WebUIDataSource;
15 }  // namespace content
16 
17 namespace chromeos {
18 namespace settings {
19 
20 class SearchTagRegistry;
21 
22 // Provides UI strings and search tags for the settings "About Chrome OS" page.
23 class AboutSection : public OsSettingsSection {
24  public:
25 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
26   AboutSection(Profile* profile,
27                SearchTagRegistry* search_tag_registry,
28                PrefService* pref_service);
29 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
30   AboutSection(Profile* profile, SearchTagRegistry* search_tag_registry);
31   ~AboutSection() override;
32 
33  private:
34   // OsSettingsSection:
35   void AddLoadTimeData(content::WebUIDataSource* html_source) override;
36   void AddHandlers(content::WebUI* web_ui) override;
37   int GetSectionNameMessageId() const override;
38   mojom::Section GetSection() const override;
39   mojom::SearchResultIcon GetSectionIcon() const override;
40   std::string GetSectionPath() const override;
41   bool LogMetric(mojom::Setting setting, base::Value& value) const override;
42   void RegisterHierarchy(HierarchyGenerator* generator) const override;
43 
44 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
45   void UpdateReportIssueSearchTags();
46 
47   PrefService* pref_service_;
48   PrefChangeRegistrar pref_change_registrar_;
49 #endif  // BUILDFLAG(GOOGLE_CHROME_BRANDING)
50 };
51 
52 }  // namespace settings
53 }  // namespace chromeos
54 
55 #endif  // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ABOUT_SECTION_H_
56