OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |