1 // Copyright 2019 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 // Functions for handling stats for system media permissions (camera, 6 // microphone). 7 8 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_SYSTEM_MEDIA_CAPTURE_PERMISSIONS_STATS_MAC_H_ 9 #define CHROME_BROWSER_MEDIA_WEBRTC_SYSTEM_MEDIA_CAPTURE_PERMISSIONS_STATS_MAC_H_ 10 11 #include "chrome/browser/media/webrtc/system_media_capture_permissions_mac.h" 12 13 class PrefRegistrySimple; 14 15 namespace system_media_permissions { 16 17 // Registers preferences used for system media permissions stats. 18 void RegisterSystemMediaPermissionStatesPrefs(PrefRegistrySimple* registry); 19 20 // Logs stats for system media permissions. Called once per browser session, at 21 // browser start. 22 void LogSystemMediaPermissionsStartupStats(); 23 24 // Called when a system permission goes from "not determined" to another state. 25 // The new permission is logged as startup state. 26 void SystemAudioCapturePermissionDetermined(SystemPermission permission); 27 void SystemVideoCapturePermissionDetermined(SystemPermission permission); 28 29 // Called when a system permission was requested but was blocked. Information 30 // stored is later used when logging stats at startup. 31 void SystemAudioCapturePermissionBlocked(); 32 void SystemVideoCapturePermissionBlocked(); 33 34 } // namespace system_media_permissions 35 36 #endif // CHROME_BROWSER_MEDIA_WEBRTC_SYSTEM_MEDIA_CAPTURE_PERMISSIONS_STATS_MAC_H_ 37