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

Side by Side Diff: ios/chrome/today_extension/today_view_controller.mm

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: nocompile test Created 3 years, 6 months 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/today_extension/today_view_controller.h" 5 #import "ios/chrome/today_extension/today_view_controller.h"
6 6
7 #import <CommonCrypto/CommonDigest.h> 7 #import <CommonCrypto/CommonDigest.h>
8 #import <NotificationCenter/NotificationCenter.h> 8 #import <NotificationCenter/NotificationCenter.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 int state = 920 int state =
921 [[LockScreenState sharedInstance] isScreenLocked] ? LOCKED_FLAG : 0; 921 [[LockScreenState sharedInstance] isScreenLocked] ? LOCKED_FLAG : 0;
922 state |= (_bluetoothIsOn ? BLUETOOTH_FLAG : 0); 922 state |= (_bluetoothIsOn ? BLUETOOTH_FLAG : 0);
923 if (!_physicalWebInInitialState) { 923 if (!_physicalWebInInitialState) {
924 state |= (_physicalWebActive ? PHYSICAL_WEB_ACTIVE_FLAG : 0); 924 state |= (_physicalWebActive ? PHYSICAL_WEB_ACTIVE_FLAG : 0);
925 state |= (_physicalWebOptedIn ? PHYSICAL_WEB_OPTED_IN_FLAG : 0); 925 state |= (_physicalWebOptedIn ? PHYSICAL_WEB_OPTED_IN_FLAG : 0);
926 } else { 926 } else {
927 state |= PHYSICAL_WEB_OPTED_IN_UNDECIDED_FLAG; 927 state |= PHYSICAL_WEB_OPTED_IN_UNDECIDED_FLAG;
928 } 928 }
929 DCHECK(state < PHYSICAL_WEB_INITIAL_STATE_COUNT); 929 DCHECK(state < PHYSICAL_WEB_INITIAL_STATE_COUNT);
930 UMA_HISTOGRAM_ENUMERATION("PhysicalWeb.InitialState", state, 930 UMA_HISTOGRAM_EXACT_LINEAR(
Alexei Svitkine (slow) 2017/05/31 20:22:24 Same comment as physical_web_initial_state_recorde
wychen 2017/07/14 23:18:44 Used PhysicalWebInitialStateIosChrome.
931 PHYSICAL_WEB_INITIAL_STATE_COUNT); 931 "PhysicalWeb.InitialState", state,
932 static_cast<int>(PHYSICAL_WEB_INITIAL_STATE_COUNT));
932 } 933 }
933 934
934 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner { 935 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner {
935 _bluetoothIsOn = [scanner bluetoothEnabled]; 936 _bluetoothIsOn = [scanner bluetoothEnabled];
936 [self reportInitialState]; 937 [self reportInitialState];
937 938
938 if (_bluetoothIsOn && _physicalWebActive) { 939 if (_bluetoothIsOn && _physicalWebActive) {
939 [self startPhysicalWeb]; 940 [self startPhysicalWeb];
940 } else { 941 } else {
941 [self stopPhysicalWeb]; 942 [self stopPhysicalWeb];
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 if (ui_util::IsRTL()) { 1098 if (ui_util::IsRTL()) {
1098 _defaultLeadingMarginInset = defaultMarginInsets.right; 1099 _defaultLeadingMarginInset = defaultMarginInsets.right;
1099 } else { 1100 } else {
1100 _defaultLeadingMarginInset = defaultMarginInsets.left; 1101 _defaultLeadingMarginInset = defaultMarginInsets.left;
1101 } 1102 }
1102 } 1103 }
1103 return UIEdgeInsetsZero; 1104 return UIEdgeInsetsZero;
1104 } 1105 }
1105 1106
1106 @end 1107 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698