Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc |
| diff --git a/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc b/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc |
| index e786d4c37ebd464958b35690aded140ebd5a9a38..0561f4177ecf52e73bdbf4d3b6a163717a492d34 100644 |
| --- a/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc |
| +++ b/chrome/browser/ui/webui/settings/chrome_cleanup_handler.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/command_line.h" |
| #include "base/feature_list.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "base/synchronization/lock.h" |
| #include "base/values.h" |
| #include "chrome/browser/safe_browsing/chrome_cleaner/srt_field_trial_win.h" |
| @@ -22,6 +23,14 @@ namespace settings { |
| namespace { |
| +// These values are used to send UMA information and are replicated in the |
| +// histograms.xml file, so the order MUST NOT CHANGE. |
| +enum CleanupCardHistogramValue { |
| + CLEANUP_CARD_SHOWN = 0, |
| + |
|
tommycli
2017/07/07 21:32:26
nit: no \n here
ftirelo
2017/07/10 19:08:51
Done.
|
| + CLEANUP_CARD_MAX, |
| +}; |
| + |
| // Returns a ListValue containing a copy of the file paths stored in |files|. |
| base::ListValue GetFilesAsListStorage(const std::set<base::FilePath>& files) { |
| base::ListValue value; |
| @@ -143,6 +152,8 @@ void ChromeCleanupHandler::HandleRegisterChromeCleanerObserver( |
| DCHECK( |
| base::FeatureList::IsEnabled(safe_browsing::kInBrowserCleanerUIFeature)); |
| + UMA_HISTOGRAM_ENUMERATION("SoftwareReporter.CleanupCard", CLEANUP_CARD_SHOWN, |
| + CLEANUP_CARD_MAX); |
| AllowJavascript(); |
| // Send the current logs upload state. |
| @@ -175,6 +186,8 @@ void ChromeCleanupHandler::HandleStartCleanup(const base::ListValue* args) { |
| // The state is propagated to all open tabs and should be consistent. |
| DCHECK_EQ(controller_->logs_enabled(), allow_logs_upload); |
| + safe_browsing::RecordCleanupStartedHistogram( |
| + safe_browsing::CLEANUP_STARTED_FROM_PROMPT_IN_SETTINGS); |
| controller_->ReplyWithUserResponse( |
| profile_, |
| allow_logs_upload |