| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 return UMA_LINUX_WINDOW_MANAGER_XMONAD; | 250 return UMA_LINUX_WINDOW_MANAGER_XMONAD; |
| 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 = | |
| 261 command_line.HasSwitch(switches::kTouchEvents) ? | |
| 262 command_line.GetSwitchValueASCII(switches::kTouchEvents) : | |
| 263 switches::kTouchEventsAuto; | |
| 264 | |
| 265 UMATouchEventsState state; | 260 UMATouchEventsState state; |
| 266 if (touch_enabled_switch.empty() || | 261 if (command_line.HasSwitch(switches::kDisableTouchEventAPI)) { |
| 267 touch_enabled_switch == switches::kTouchEventsEnabled) { | |
| 268 state = UMA_TOUCH_EVENTS_ENABLED; | |
| 269 } else if (touch_enabled_switch == switches::kTouchEventsAuto) { | |
| 270 state = (ui::GetTouchScreensAvailability() == | |
| 271 ui::TouchScreensAvailability::ENABLED) | |
| 272 ? UMA_TOUCH_EVENTS_AUTO_ENABLED | |
| 273 : UMA_TOUCH_EVENTS_AUTO_DISABLED; | |
| 274 } else if (touch_enabled_switch == switches::kTouchEventsDisabled) { | |
| 275 state = UMA_TOUCH_EVENTS_DISABLED; | 262 state = UMA_TOUCH_EVENTS_DISABLED; |
| 276 } else { | 263 } else { |
| 277 NOTREACHED(); | 264 state = UMA_TOUCH_EVENTS_ENABLED; |
| 278 return; | |
| 279 } | 265 } |
| 280 | |
| 281 UMA_HISTOGRAM_ENUMERATION("Touchscreen.TouchEventsEnabled", state, | 266 UMA_HISTOGRAM_ENUMERATION("Touchscreen.TouchEventsEnabled", state, |
| 282 UMA_TOUCH_EVENTS_STATE_COUNT); | 267 UMA_TOUCH_EVENTS_STATE_COUNT); |
| 283 } | 268 } |
| 284 | 269 |
| 285 #if defined(USE_OZONE) || defined(USE_X11) | 270 #if defined(USE_OZONE) || defined(USE_X11) |
| 286 | 271 |
| 287 // Asynchronously records the touch event state when the ui::DeviceDataManager | 272 // Asynchronously records the touch event state when the ui::DeviceDataManager |
| 288 // completes a device scan. | 273 // completes a device scan. |
| 289 class AsynchronousTouchEventStateRecorder | 274 class AsynchronousTouchEventStateRecorder |
| 290 : public ui::InputDeviceEventObserver { | 275 : public ui::InputDeviceEventObserver { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 391 } |
| 407 } | 392 } |
| 408 | 393 |
| 409 namespace chrome { | 394 namespace chrome { |
| 410 | 395 |
| 411 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 396 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
| 412 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 397 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
| 413 } | 398 } |
| 414 | 399 |
| 415 } // namespace chrome | 400 } // namespace chrome |
| OLD | NEW |