| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::kTouchEvents) ? |
| 262 command_line.GetSwitchValueASCII(switches::kTouchEvents) : | 262 command_line.GetSwitchValueASCII(switches::kTouchEvents) : |
| 263 switches::kTouchEventsAuto; | 263 switches::kTouchEventsEnabled; |
| 264 | 264 |
| 265 UMATouchEventsState state; | 265 UMATouchEventsState state; |
| 266 if (touch_enabled_switch.empty() || | 266 if (touch_enabled_switch.empty() || |
| 267 touch_enabled_switch == switches::kTouchEventsEnabled) { | 267 touch_enabled_switch == switches::kTouchEventsEnabled || |
| 268 touch_enabled_switch == switches::kTouchEventsAuto) { |
| 268 state = UMA_TOUCH_EVENTS_ENABLED; | 269 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) { | 270 } else if (touch_enabled_switch == switches::kTouchEventsDisabled) { |
| 275 state = UMA_TOUCH_EVENTS_DISABLED; | 271 state = UMA_TOUCH_EVENTS_DISABLED; |
| 276 } else { | 272 } else { |
| 277 NOTREACHED(); | 273 NOTREACHED(); |
| 278 return; | 274 return; |
| 279 } | 275 } |
| 280 | 276 |
| 281 UMA_HISTOGRAM_ENUMERATION("Touchscreen.TouchEventsEnabled", state, | 277 UMA_HISTOGRAM_ENUMERATION("Touchscreen.TouchEventsEnabled", state, |
| 282 UMA_TOUCH_EVENTS_STATE_COUNT); | 278 UMA_TOUCH_EVENTS_STATE_COUNT); |
| 283 } | 279 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 402 } |
| 407 } | 403 } |
| 408 | 404 |
| 409 namespace chrome { | 405 namespace chrome { |
| 410 | 406 |
| 411 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 407 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
| 412 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 408 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
| 413 } | 409 } |
| 414 | 410 |
| 415 } // namespace chrome | 411 } // namespace chrome |
| OLD | NEW |