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

Side by Side Diff: ui/base/touch/touch_enabled.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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 | « ui/base/ime/remote_input_method_win.cc ('k') | ui/base/ui_base_switches_util.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ui/base/touch/touch_enabled.h" 5 #include "ui/base/touch/touch_enabled.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/touch/touch_device.h" 8 #include "ui/base/touch/touch_device.h"
9 #include "ui/base/ui_base_switches.h" 9 #include "ui/base/ui_base_switches.h"
10 #include "ui/events/event_switches.h" 10 #include "ui/events/event_switches.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 bool AreTouchEventsEnabled() { 14 bool AreTouchEventsEnabled() {
15 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 15 const base::CommandLine& command_line =
16 *base::CommandLine::ForCurrentProcess();
16 const std::string touch_enabled_switch = 17 const std::string touch_enabled_switch =
17 command_line.HasSwitch(switches::kTouchEvents) ? 18 command_line.HasSwitch(switches::kTouchEvents) ?
18 command_line.GetSwitchValueASCII(switches::kTouchEvents) : 19 command_line.GetSwitchValueASCII(switches::kTouchEvents) :
19 switches::kTouchEventsAuto; 20 switches::kTouchEventsAuto;
20 21
21 if (touch_enabled_switch.empty() || 22 if (touch_enabled_switch.empty() ||
22 touch_enabled_switch == switches::kTouchEventsEnabled) 23 touch_enabled_switch == switches::kTouchEventsEnabled)
23 return true; 24 return true;
24 if (touch_enabled_switch == switches::kTouchEventsAuto) 25 if (touch_enabled_switch == switches::kTouchEventsAuto)
25 return IsTouchDevicePresent(); 26 return IsTouchDevicePresent();
26 if (touch_enabled_switch != switches::kTouchEventsDisabled) 27 if (touch_enabled_switch != switches::kTouchEventsDisabled)
27 LOG(ERROR) << "Invalid --touch-events option: " << touch_enabled_switch; 28 LOG(ERROR) << "Invalid --touch-events option: " << touch_enabled_switch;
28 return false; 29 return false;
29 } 30 }
30 31
31 } // namespace ui 32 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/base/ui_base_switches_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698