Commit 80fdc9c2 authored by harrisonsean's avatar harrisonsean Committed by Commit Bot

[iOS][Safety Check] Add UMA metrics to safety check

Add overall interaction metrics (with actions) and individual
metrics for each of the checks.

Bug: 1078782
Change-Id: Ic778e9ef54e9f358e28eab5b4b7ac30a7ad5d99d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442531Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Commit-Queue: Sean Harrison <harrisonsean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812912}
parent 803bd037
...@@ -71,6 +71,7 @@ include_rules = [ ...@@ -71,6 +71,7 @@ include_rules = [
"+components/reading_list", "+components/reading_list",
"+components/rlz", "+components/rlz",
"+components/safe_browsing", "+components/safe_browsing",
"+components/safety_check",
"+components/search", "+components/search",
"+components/search_engines", "+components/search_engines",
"+components/search_provider_logos", "+components/search_provider_logos",
......
...@@ -7,6 +7,24 @@ ...@@ -7,6 +7,24 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
// UMA histogram values for Safety check interactions. Some value don't apply to
// iOS. Note: this should stay in sync with SettingsSafetyCheckInteractions in
// enums.xml.
enum class SafetyCheckInteractions {
kStarted = 0,
kUpdatesRelaunch = 1,
kPasswordsManage = 2,
kSafeBrowsingManage = 3,
kExtensionsReview = 4,
kChromeCleanerReboot = 5,
kChromeCleanerReview = 6,
// New elements go above.
kMaxValue = kChromeCleanerReview,
};
// Address of page with safebrowsing settings pages.
extern NSString* const kSafeBrowsingSafetyCheckStringURL;
// The NSUserDefaults key for the timestamp of last time safety check found an // The NSUserDefaults key for the timestamp of last time safety check found an
// issue. // issue.
extern NSString* const kTimestampOfLastIssueFoundKey; extern NSString* const kTimestampOfLastIssueFoundKey;
......
...@@ -8,5 +8,8 @@ ...@@ -8,5 +8,8 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
NSString* const kSafeBrowsingSafetyCheckStringURL =
@"chrome://settings/syncSetup";
NSString* const kTimestampOfLastIssueFoundKey = NSString* const kTimestampOfLastIssueFoundKey =
@"TimestampOfLastSafetyCheckIssueFound"; @"TimestampOfLastSafetyCheckIssueFound";
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
#import "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
...@@ -24,6 +27,7 @@ ...@@ -24,6 +27,7 @@
#import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h" #import "ios/chrome/browser/ui/settings/elements/enterprise_info_popover_view_controller.h"
#import "ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.h" #import "ios/chrome/browser/ui/settings/google_services/google_services_settings_coordinator.h"
#import "ios/chrome/browser/ui/settings/password/password_issues_coordinator.h" #import "ios/chrome/browser/ui/settings/password/password_issues_coordinator.h"
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_constants.h"
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.h" #import "ios/chrome/browser/ui/settings/safety_check/safety_check_mediator.h"
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_navigation_commands.h" #import "ios/chrome/browser/ui/settings/safety_check/safety_check_navigation_commands.h"
#import "ios/chrome/browser/ui/settings/safety_check/safety_check_table_view_controller.h" #import "ios/chrome/browser/ui/settings/safety_check/safety_check_table_view_controller.h"
...@@ -124,7 +128,8 @@ ...@@ -124,7 +128,8 @@
- (void)didTapLinkURL:(NSURL*)URL { - (void)didTapLinkURL:(NSURL*)URL {
GURL convertedURL = net::GURLWithNSURL(URL); GURL convertedURL = net::GURLWithNSURL(URL);
const GURL safeBrowsingURL(kSafeBrowsingStringURL); const GURL safeBrowsingURL(
base::SysNSStringToUTF8(kSafeBrowsingSafetyCheckStringURL));
// Take the user to Sync and Google Services page in Bling instead of desktop // Take the user to Sync and Google Services page in Bling instead of desktop
// settings. // settings.
...@@ -189,6 +194,10 @@ ...@@ -189,6 +194,10 @@
- (void)showSafeBrowsingPreferencePage { - (void)showSafeBrowsingPreferencePage {
DCHECK(!self.googleServicesSettingsCoordinator); DCHECK(!self.googleServicesSettingsCoordinator);
base::RecordAction(
base::UserMetricsAction("Settings.SafetyCheck.ManageSafeBrowsing"));
base::UmaHistogramEnumeration("Settings.SafetyCheck.Interactions",
SafetyCheckInteractions::kSafeBrowsingManage);
self.googleServicesSettingsCoordinator = self.googleServicesSettingsCoordinator =
[[GoogleServicesSettingsCoordinator alloc] [[GoogleServicesSettingsCoordinator alloc]
initWithBaseNavigationController:self.baseNavigationController initWithBaseNavigationController:self.baseNavigationController
......
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