Commit adc7635d authored by Daniel Classon's avatar Daniel Classon Committed by Commit Bot

[OsSettingsMetrics] Add LogMetrics to OS Settings Sections

Adds a new virtual function to OS Settings Sections that takes in a
mojom::Setting and an optional Value and logs the corresponding metrics.
Left unimplemented in most sections for now.

Bug: 1133553
Change-Id: I5784fa827e7c3a2b5b960b6dd309f8fed0960183
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2439498
Commit-Queue: Daniel Classon <dclasson@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812386}
parent 0eff6293
......@@ -350,6 +350,12 @@ std::string AboutSection::GetSectionPath() const {
return mojom::kAboutChromeOsSectionPath;
}
bool AboutSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void AboutSection::RegisterHierarchy(HierarchyGenerator* generator) const {
// About Chrome OS.
generator->RegisterTopLevelSubpage(
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ABOUT_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ABOUT_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -37,6 +39,8 @@ class AboutSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
......
......@@ -614,6 +614,12 @@ mojom::SearchResultIcon AccessibilitySection::GetSectionIcon() const {
std::string AccessibilitySection::GetSectionPath() const {
return mojom::kAccessibilitySectionPath;
}
bool AccessibilitySection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void AccessibilitySection::RegisterHierarchy(
HierarchyGenerator* generator) const {
......
......@@ -5,7 +5,9 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ACCESSIBILITY_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_ACCESSIBILITY_SECTION_H_
#include "base/optional.h"
#include "base/scoped_observer.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "components/prefs/pref_change_registrar.h"
#include "content/public/browser/tts_controller.h"
......@@ -41,6 +43,8 @@ class AccessibilitySection : public OsSettingsSection,
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// content::VoicesChangedDelegate:
......
......@@ -238,6 +238,12 @@ std::string AppsSection::GetSectionPath() const {
return mojom::kAppsSectionPath;
}
bool AppsSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void AppsSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kTurnOnPlayStore);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_APPS_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_APPS_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -37,6 +39,8 @@ class AppsSection : public OsSettingsSection, public ArcAppListPrefs::Observer {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// ArcAppListPrefs::Observer:
......
......@@ -207,6 +207,13 @@ std::string BluetoothSection::GetSectionPath() const {
return mojom::kBluetoothSectionPath;
}
bool BluetoothSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void BluetoothSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSubpage(IDS_SETTINGS_BLUETOOTH,
mojom::Subpage::kBluetoothDevices,
......
......@@ -7,6 +7,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "device/bluetooth/bluetooth_adapter.h"
......@@ -35,6 +37,8 @@ class BluetoothSection : public OsSettingsSection,
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// device::BluetoothAdapter::Observer:
......
......@@ -452,6 +452,13 @@ std::string CrostiniSection::GetSectionPath() const {
return mojom::kCrostiniSectionPath;
}
bool CrostiniSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void CrostiniSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kSetUpCrostini);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CROSTINI_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CROSTINI_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -35,6 +37,8 @@ class CrostiniSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
bool IsCrostiniAllowed();
......
......@@ -153,6 +153,13 @@ std::string DateTimeSection::GetSectionPath() const {
return mojom::kDateAndTimeSectionPath;
}
bool DateTimeSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void DateTimeSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::k24HourClock);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DATE_TIME_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DATE_TIME_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace content {
......@@ -30,6 +32,8 @@ class DateTimeSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
};
......
......@@ -840,6 +840,12 @@ std::string DeviceSection::GetSectionPath() const {
return mojom::kDeviceSectionPath;
}
bool DeviceSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void DeviceSection::RegisterHierarchy(HierarchyGenerator* generator) const {
// Pointers.
generator->RegisterTopLevelSubpage(
......
......@@ -11,6 +11,7 @@
#include "ash/public/mojom/cros_display_config.mojom.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/chromeos/system/pointer_device_observer.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "chromeos/dbus/power/power_manager_client.h"
......@@ -50,6 +51,8 @@ class DeviceSection : public OsSettingsSection,
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// system::PointerDeviceObserver::Observer:
......
......@@ -32,6 +32,12 @@ std::string FakeOsSettingsSection::GetSectionPath() const {
return std::string();
}
bool FakeOsSettingsSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
return false;
}
std::string FakeOsSettingsSection::ModifySearchResultUrl(
mojom::SearchResultType type,
OsSettingsIdentifier id,
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FAKE_OS_SETTINGS_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FAKE_OS_SETTINGS_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace chromeos {
......@@ -33,6 +35,8 @@ class FakeOsSettingsSection : public OsSettingsSection {
// These functions return arbitrary dummy values.
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
// Prepends the section name and "::" to the URL in |concept|. For example, if
// the URL is "networkDetails" and the section is mojom::Section::kNetwork,
......
......@@ -119,6 +119,12 @@ std::string FilesSection::GetSectionPath() const {
return mojom::kFilesSectionPath;
}
bool FilesSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void FilesSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kGoogleDriveConnection);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FILES_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FILES_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace content {
......@@ -30,6 +32,8 @@ class FilesSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
};
......
......@@ -739,6 +739,13 @@ std::string InternetSection::GetSectionPath() const {
return mojom::kNetworkSectionPath;
}
bool InternetSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void InternetSection::RegisterHierarchy(HierarchyGenerator* generator) const {
// Ethernet details.
generator->RegisterTopLevelSubpage(IDS_SETTINGS_INTERNET_ETHERNET_DETAILS,
......
......@@ -9,6 +9,7 @@
#include <vector>
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
......@@ -40,6 +41,8 @@ class InternetSection
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
std::string ModifySearchResultUrl(
mojom::SearchResultType type,
......
......@@ -450,6 +450,13 @@ std::string LanguagesSection::GetSectionPath() const {
return mojom::kLanguagesAndInputSectionPath;
}
bool LanguagesSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void LanguagesSection::RegisterHierarchy(HierarchyGenerator* generator) const {
// Languages.
generator->RegisterTopLevelSubpage(
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_LANGUAGES_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_LANGUAGES_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -35,6 +37,8 @@ class LanguagesSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
bool IsEmojiSuggestionAllowed() const;
......
......@@ -226,6 +226,12 @@ std::string MainSection::GetSectionPath() const {
return std::string();
}
bool MainSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
NOTIMPLEMENTED();
return false;
}
void MainSection::RegisterHierarchy(HierarchyGenerator* generator) const {
// MainSection is a container for common resources/functionality shared
// between sections and does not have its own subpages/settings.
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_MAIN_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_MAIN_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace content {
......@@ -30,6 +32,8 @@ class MainSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
void AddChromeOSUserStrings(content::WebUIDataSource* html_source);
......
......@@ -418,6 +418,13 @@ std::string MultiDeviceSection::GetSectionPath() const {
return mojom::kMultiDeviceSectionPath;
}
bool MultiDeviceSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void MultiDeviceSection::RegisterHierarchy(
HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kSetUpMultiDevice);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_MULTIDEVICE_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_MULTIDEVICE_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -53,6 +55,8 @@ class MultiDeviceSection
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// multidevice_setup::MultiDeviceSetupClient::Observer:
......
......@@ -9,7 +9,9 @@
#include <vector>
#include "base/containers/span.h"
#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h"
#include "chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom.h"
#include "chrome/browser/ui/webui/settings/chromeos/search/search.mojom.h"
......@@ -118,6 +120,11 @@ class OsSettingsSection {
// Provides the path for this section.
virtual std::string GetSectionPath() const = 0;
// Logs metrics for the updated |setting| with optional |value|. Returns
// whether the setting change was logged.
virtual bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const = 0;
// Registers the subpages and/or settings which reside in this section.
virtual void RegisterHierarchy(HierarchyGenerator* generator) const = 0;
......
......@@ -918,6 +918,12 @@ std::string PeopleSection::GetSectionPath() const {
return mojom::kPeopleSectionPath;
}
bool PeopleSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void PeopleSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kSetUpParentalControls);
......
......@@ -6,6 +6,8 @@
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PEOPLE_SECTION_H_
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/chromeos/kerberos/kerberos_credentials_manager.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "chromeos/components/account_manager/account_manager.h"
......@@ -62,6 +64,8 @@ class PeopleSection : public OsSettingsSection,
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// AccountManager::Observer:
......
......@@ -274,6 +274,13 @@ std::string PersonalizationSection::GetSectionPath() const {
return mojom::kPersonalizationSectionPath;
}
bool PersonalizationSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void PersonalizationSection::RegisterHierarchy(
HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kOpenWallpaper);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PERSONALIZATION_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PERSONALIZATION_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -37,6 +39,8 @@ class PersonalizationSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// ash::AmbientModeService::Observer:
......
......@@ -274,6 +274,13 @@ std::string PrintingSection::GetSectionPath() const {
return mojom::kPrintingSectionPath;
}
bool PrintingSection::LogMetric(
mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void PrintingSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kPrintJobs);
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PRINTING_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PRINTING_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/chromeos/printing/cups_printers_manager.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
......@@ -37,6 +39,8 @@ class PrintingSection : public OsSettingsSection,
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// CupsPrintersManager::Observer
......
......@@ -115,6 +115,12 @@ std::string PrivacySection::GetSectionPath() const {
return mojom::kPrivacyAndSecuritySectionPath;
}
bool PrivacySection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void PrivacySection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kVerifiedAccess);
generator->RegisterTopLevelSetting(
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PRIVACY_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_PRIVACY_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace content {
......@@ -30,6 +32,8 @@ class PrivacySection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
};
......
......@@ -107,6 +107,12 @@ std::string ResetSection::GetSectionPath() const {
return mojom::kResetSectionPath;
}
bool ResetSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void ResetSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kPowerwash);
}
......
......@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_RESET_SECTION_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_RESET_SECTION_H_
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace content {
......@@ -32,6 +34,8 @@ class ResetSection : public OsSettingsSection {
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
};
......
......@@ -266,6 +266,12 @@ std::string SearchSection::GetSectionPath() const {
return mojom::kSearchAndAssistantSectionPath;
}
bool SearchSection::LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const {
// Unimplemented.
return false;
}
void SearchSection::RegisterHierarchy(HierarchyGenerator* generator) const {
generator->RegisterTopLevelSetting(mojom::Setting::kPreferredSearchEngine);
......
......@@ -6,6 +6,8 @@
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_SEARCH_SECTION_H_
#include "ash/public/cpp/assistant/assistant_state_base.h"
#include "base/optional.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/settings/chromeos/os_settings_section.h"
namespace content {
......@@ -34,6 +36,8 @@ class SearchSection : public OsSettingsSection,
mojom::Section GetSection() const override;
mojom::SearchResultIcon GetSectionIcon() const override;
std::string GetSectionPath() const override;
bool LogMetric(mojom::Setting setting,
const base::Optional<base::Value>& value) const override;
void RegisterHierarchy(HierarchyGenerator* generator) const override;
// ash::AssistantStateObserver:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment