| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" | 5 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 UMA_LINUX_WINDOW_MANAGER_WMII, | 93 UMA_LINUX_WINDOW_MANAGER_WMII, |
| 94 UMA_LINUX_WINDOW_MANAGER_FLUXBOX, | 94 UMA_LINUX_WINDOW_MANAGER_FLUXBOX, |
| 95 UMA_LINUX_WINDOW_MANAGER_XMONAD, | 95 UMA_LINUX_WINDOW_MANAGER_XMONAD, |
| 96 UMA_LINUX_WINDOW_MANAGER_UNNAMED, | 96 UMA_LINUX_WINDOW_MANAGER_UNNAMED, |
| 97 // NOTE: Append new window managers to the list above this line (i.e. don't | 97 // NOTE: Append new window managers to the list above this line (i.e. don't |
| 98 // renumber) and update LinuxWindowManagerName in | 98 // renumber) and update LinuxWindowManagerName in |
| 99 // tools/metrics/histograms/histograms.xml accordingly. | 99 // tools/metrics/histograms/histograms.xml accordingly. |
| 100 UMA_LINUX_WINDOW_MANAGER_COUNT | 100 UMA_LINUX_WINDOW_MANAGER_COUNT |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 enum UMATouchEventsState { | 103 enum UMATouchEventFeatureDetectionState { |
| 104 UMA_TOUCH_EVENTS_ENABLED, | 104 UMA_TOUCH_EVENT_FEATURE_DETECTION_ENABLED, |
| 105 UMA_TOUCH_EVENTS_AUTO_ENABLED, | 105 UMA_TOUCH_EVENT_FEATURE_DETECTION_AUTO_ENABLED, |
| 106 UMA_TOUCH_EVENTS_AUTO_DISABLED, | 106 UMA_TOUCH_EVENT_FEATURE_DETECTION_AUTO_DISABLED, |
| 107 UMA_TOUCH_EVENTS_DISABLED, | 107 UMA_TOUCH_EVENT_FEATURE_DETECTION_DISABLED, |
| 108 // NOTE: Add states only immediately above this line. Make sure to | 108 // NOTE: Add states only immediately above this line. Make sure to |
| 109 // update the enum list in tools/metrics/histograms/histograms.xml | 109 // update the enum list in tools/metrics/histograms/histograms.xml |
| 110 // accordingly. | 110 // accordingly. |
| 111 UMA_TOUCH_EVENTS_STATE_COUNT | 111 UMA_TOUCH_EVENT_FEATURE_DETECTION_STATE_COUNT |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 #if defined(OS_ANDROID) && defined(__arm__) | 114 #if defined(OS_ANDROID) && defined(__arm__) |
| 115 enum UMAAndroidArmFpu { | 115 enum UMAAndroidArmFpu { |
| 116 UMA_ANDROID_ARM_FPU_VFPV3_D16, // The ARM CPU only supports vfpv3-d16. | 116 UMA_ANDROID_ARM_FPU_VFPV3_D16, // The ARM CPU only supports vfpv3-d16. |
| 117 UMA_ANDROID_ARM_FPU_NEON, // The Arm CPU supports NEON. | 117 UMA_ANDROID_ARM_FPU_NEON, // The Arm CPU supports NEON. |
| 118 UMA_ANDROID_ARM_FPU_COUNT | 118 UMA_ANDROID_ARM_FPU_COUNT |
| 119 }; | 119 }; |
| 120 #endif // defined(OS_ANDROID) && defined(__arm__) | 120 #endif // defined(OS_ANDROID) && defined(__arm__) |
| 121 | 121 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 251 } |
| 252 NOTREACHED(); | 252 NOTREACHED(); |
| 253 return UMA_LINUX_WINDOW_MANAGER_OTHER; | 253 return UMA_LINUX_WINDOW_MANAGER_OTHER; |
| 254 } | 254 } |
| 255 #endif | 255 #endif |
| 256 | 256 |
| 257 void RecordTouchEventState() { | 257 void RecordTouchEventState() { |
| 258 const base::CommandLine& command_line = | 258 const base::CommandLine& command_line = |
| 259 *base::CommandLine::ForCurrentProcess(); | 259 *base::CommandLine::ForCurrentProcess(); |
| 260 const std::string touch_enabled_switch = | 260 const std::string touch_enabled_switch = |
| 261 command_line.HasSwitch(switches::kTouchEvents) | 261 command_line.HasSwitch(switches::kTouchEventFeatureDetection) |
| 262 ? command_line.GetSwitchValueASCII(switches::kTouchEvents) | 262 ? command_line.GetSwitchValueASCII( |
| 263 : switches::kTouchEventsAuto; | 263 switches::kTouchEventFeatureDetection) |
| 264 : switches::kTouchEventFeatureDetectionAuto; |
| 264 | 265 |
| 265 UMATouchEventsState state; | 266 UMATouchEventFeatureDetectionState state; |
| 266 if (touch_enabled_switch.empty() || | 267 if (touch_enabled_switch.empty() || |
| 267 touch_enabled_switch == switches::kTouchEventsEnabled) { | 268 touch_enabled_switch == switches::kTouchEventFeatureDetectionEnabled) { |
| 268 state = UMA_TOUCH_EVENTS_ENABLED; | 269 state = UMA_TOUCH_EVENT_FEATURE_DETECTION_ENABLED; |
| 269 } else if (touch_enabled_switch == switches::kTouchEventsAuto) { | 270 } else if (touch_enabled_switch == |
| 271 switches::kTouchEventFeatureDetectionAuto) { |
| 270 state = (ui::GetTouchScreensAvailability() == | 272 state = (ui::GetTouchScreensAvailability() == |
| 271 ui::TouchScreensAvailability::ENABLED) | 273 ui::TouchScreensAvailability::ENABLED) |
| 272 ? UMA_TOUCH_EVENTS_AUTO_ENABLED | 274 ? UMA_TOUCH_EVENT_FEATURE_DETECTION_AUTO_ENABLED |
| 273 : UMA_TOUCH_EVENTS_AUTO_DISABLED; | 275 : UMA_TOUCH_EVENT_FEATURE_DETECTION_AUTO_DISABLED; |
| 274 } else if (touch_enabled_switch == switches::kTouchEventsDisabled) { | 276 } else if (touch_enabled_switch == |
| 275 state = UMA_TOUCH_EVENTS_DISABLED; | 277 switches::kTouchEventFeatureDetectionDisabled) { |
| 278 state = UMA_TOUCH_EVENT_FEATURE_DETECTION_DISABLED; |
| 276 } else { | 279 } else { |
| 277 NOTREACHED(); | 280 NOTREACHED(); |
| 278 return; | 281 return; |
| 279 } | 282 } |
| 280 | 283 |
| 281 UMA_HISTOGRAM_ENUMERATION("Touchscreen.TouchEventsEnabled", state, | 284 UMA_HISTOGRAM_ENUMERATION("Touchscreen.TouchEventsEnabled", state, |
| 282 UMA_TOUCH_EVENTS_STATE_COUNT); | 285 UMA_TOUCH_EVENT_FEATURE_DETECTION_STATE_COUNT); |
| 283 } | 286 } |
| 284 | 287 |
| 285 #if defined(USE_OZONE) || defined(USE_X11) | 288 #if defined(USE_OZONE) || defined(USE_X11) |
| 286 | 289 |
| 287 // Asynchronously records the touch event state when the ui::DeviceDataManager | 290 // Asynchronously records the touch event state when the ui::DeviceDataManager |
| 288 // completes a device scan. | 291 // completes a device scan. |
| 289 class AsynchronousTouchEventStateRecorder | 292 class AsynchronousTouchEventStateRecorder |
| 290 : public ui::InputDeviceEventObserver { | 293 : public ui::InputDeviceEventObserver { |
| 291 public: | 294 public: |
| 292 AsynchronousTouchEventStateRecorder(); | 295 AsynchronousTouchEventStateRecorder(); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 } | 439 } |
| 437 } | 440 } |
| 438 | 441 |
| 439 namespace chrome { | 442 namespace chrome { |
| 440 | 443 |
| 441 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 444 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
| 442 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 445 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
| 443 } | 446 } |
| 444 | 447 |
| 445 } // namespace chrome | 448 } // namespace chrome |
| OLD | NEW |