Commit 543a38d7 authored by Harry Cutts's avatar Harry Cutts Committed by Commit Bot

chromeos: use utility functions for prefs UMA reporting

This makes the `if` statements in `ApplyPreferences` easier to read.

Bug: none
Test: change a preference and check chrome://histograms shows the sample
Change-Id: I99fdb9ad29d4f6df33444f7b12c20a1a5784f4d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491973Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Harry Cutts <hcutts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826927}
parent 39ba84d4
This diff is collapsed.
......@@ -76,6 +76,19 @@ class Preferences : public sync_preferences::PrefServiceSyncableObserver,
// Callback method for preference changes.
void OnPreferenceChanged(const std::string& pref_name);
// Add a sample to the appropriate UMA histogram for a boolean preference.
void ReportBooleanPrefApplication(ApplyReason reason,
const std::string& changed_histogram_name,
const std::string& started_histogram_name,
bool sample);
// Add a sample to the appropriate UMA histogram for a sensitivity preference.
void ReportSensitivityPrefApplication(
ApplyReason reason,
const std::string& changed_histogram_name,
const std::string& started_histogram_name,
int sensitivity_int);
// This will set the OS settings when the preference changed or the user
// owning these preferences became active. Also this method is called on
// initialization. The reason of the call is stored as the |reason| parameter.
......
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