Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: components/autofill/ios/browser/keyboard_accessory_metrics_logger.mm

Issue 1446473002: Enable compilation of //components/autofill on iOS with gn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@os_crypt
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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 #import "components/autofill/ios/browser/keyboard_accessory_metrics_logger.h"
6
7 #import <UIKit/UIKit.h>
8
9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h"
11
12 namespace autofill {
13
14 namespace {
15
16 void Log(KeyboardAccessoryMetricsLogger::ButtonMetric metric) {
17 DCHECK_LT(metric, KeyboardAccessoryMetricsLogger::NUM_BUTTON_METRICS);
18 if (UIAccessibilityIsVoiceOverRunning()) {
19 UMA_HISTOGRAM_ENUMERATION(
20 "Autofill.KeyboardAccessoryButtonsIOS_ScreenReaderOn", metric,
21 KeyboardAccessoryMetricsLogger::NUM_BUTTON_METRICS);
22 } else {
23 UMA_HISTOGRAM_ENUMERATION(
24 "Autofill.KeyboardAccessoryButtonsIOS_ScreenReaderOff", metric,
25 KeyboardAccessoryMetricsLogger::NUM_BUTTON_METRICS);
26 }
27 }
28
29 } // namespace
30
31 KeyboardAccessoryMetricsLogger::KeyboardAccessoryMetricsLogger()
32 : has_logged_close_button_(false),
33 has_logged_next_button_(false),
34 has_logged_previous_button_(false) {}
35
36 // static
37 void KeyboardAccessoryMetricsLogger::OnFormsLoaded() {
38 Log(FORMS_LOADED);
39 }
40
41 // static
42 void KeyboardAccessoryMetricsLogger::OnFormSubmitted() {
43 Log(SUBMITTED_FORM);
44 }
45
46 void KeyboardAccessoryMetricsLogger::OnCloseButtonPressed() {
47 Log(CLOSE_BUTTON_PRESSED);
48 if (!has_logged_close_button_) {
49 has_logged_close_button_ = true;
50 Log(CLOSE_BUTTON_PRESSED_ONCE);
51 }
52 }
53
54 void KeyboardAccessoryMetricsLogger::OnNextButtonPressed() {
55 Log(NEXT_BUTTON_PRESSED);
56 if (!has_logged_next_button_) {
57 has_logged_next_button_ = true;
58 Log(NEXT_BUTTON_PRESSED_ONCE);
59 }
60 }
61
62 void KeyboardAccessoryMetricsLogger::OnPreviousButtonPressed() {
63 Log(PREVIOUS_BUTTON_PRESSED);
64 if (!has_logged_previous_button_) {
65 has_logged_previous_button_ = true;
66 Log(PREVIOUS_BUTTON_PRESSED_ONCE);
67 }
68 }
69
70 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/ios/browser/keyboard_accessory_metrics_logger.h ('k') | components/password_manager/core/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698