scanning_metrics_handler.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2021 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. #ifndef ASH_WEBUI_SCANNING_SCANNING_METRICS_HANDLER_H_
  5. #define ASH_WEBUI_SCANNING_SCANNING_METRICS_HANDLER_H_
  6. #include "base/values.h"
  7. #include "content/public/browser/web_ui_message_handler.h"
  8. namespace ash {
  9. // ChromeOS Scan app metrics handler for recording metrics from the UI.
  10. class ScanningMetricsHandler : public content::WebUIMessageHandler {
  11. public:
  12. ScanningMetricsHandler();
  13. ~ScanningMetricsHandler() override;
  14. ScanningMetricsHandler(const ScanningMetricsHandler&) = delete;
  15. ScanningMetricsHandler& operator=(const ScanningMetricsHandler&) = delete;
  16. // WebUIMessageHandler:
  17. void RegisterMessages() override;
  18. private:
  19. // Records the number of scan setting changes before a scan is initiated.
  20. void HandleRecordNumScanSettingChanges(const base::Value::List& args);
  21. // Records the action taken after a completed scan job.
  22. void HandleRecordScanCompleteAction(const base::Value::List& args);
  23. // Records the settings for a scan job.
  24. void HandleRecordScanJobSettings(const base::Value::List& args);
  25. // Records the number of completed scans in a Scan app session.
  26. void HandleRecordNumCompletedScans(const base::Value::List& args);
  27. };
  28. } // namespace ash
  29. #endif // ASH_WEBUI_SCANNING_SCANNING_METRICS_HANDLER_H_