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

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: simplify type checking Created 3 years, 5 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
« no previous file with comments | « ios/chrome/browser/ui/sync/sync_util.mm ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 int state = 910 int state =
911 [[LockScreenState sharedInstance] isScreenLocked] ? LOCKED_FLAG : 0; 911 [[LockScreenState sharedInstance] isScreenLocked] ? LOCKED_FLAG : 0;
912 state |= (_bluetoothIsOn ? BLUETOOTH_FLAG : 0); 912 state |= (_bluetoothIsOn ? BLUETOOTH_FLAG : 0);
913 if (!_physicalWebInInitialState) { 913 if (!_physicalWebInInitialState) {
914 state |= (_physicalWebActive ? PHYSICAL_WEB_ACTIVE_FLAG : 0); 914 state |= (_physicalWebActive ? PHYSICAL_WEB_ACTIVE_FLAG : 0);
915 state |= (_physicalWebOptedIn ? PHYSICAL_WEB_OPTED_IN_FLAG : 0); 915 state |= (_physicalWebOptedIn ? PHYSICAL_WEB_OPTED_IN_FLAG : 0);
916 } else { 916 } else {
917 state |= PHYSICAL_WEB_OPTED_IN_UNDECIDED_FLAG; 917 state |= PHYSICAL_WEB_OPTED_IN_UNDECIDED_FLAG;
918 } 918 }
919 DCHECK(state < PHYSICAL_WEB_INITIAL_STATE_COUNT); 919 DCHECK(state < PHYSICAL_WEB_INITIAL_STATE_COUNT);
920 UMA_HISTOGRAM_ENUMERATION("PhysicalWeb.InitialState", state, 920 UMA_HISTOGRAM_ENUMERATION("PhysicalWeb.InitialState",
921 static_cast<PhysicalWebInitialState>(state),
921 PHYSICAL_WEB_INITIAL_STATE_COUNT); 922 PHYSICAL_WEB_INITIAL_STATE_COUNT);
922 } 923 }
923 924
924 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner { 925 - (void)scannerBluetoothStatusUpdated:(PhysicalWebScanner*)scanner {
925 _bluetoothIsOn = [scanner bluetoothEnabled]; 926 _bluetoothIsOn = [scanner bluetoothEnabled];
926 [self reportInitialState]; 927 [self reportInitialState];
927 928
928 if (_bluetoothIsOn && _physicalWebActive) { 929 if (_bluetoothIsOn && _physicalWebActive) {
929 [self startPhysicalWeb]; 930 [self startPhysicalWeb];
930 } else { 931 } else {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 if (ui_util::IsRTL()) { 1088 if (ui_util::IsRTL()) {
1088 _defaultLeadingMarginInset = defaultMarginInsets.right; 1089 _defaultLeadingMarginInset = defaultMarginInsets.right;
1089 } else { 1090 } else {
1090 _defaultLeadingMarginInset = defaultMarginInsets.left; 1091 _defaultLeadingMarginInset = defaultMarginInsets.left;
1091 } 1092 }
1092 } 1093 }
1093 return UIEdgeInsetsZero; 1094 return UIEdgeInsetsZero;
1094 } 1095 }
1095 1096
1096 @end 1097 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/sync/sync_util.mm ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698