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

Side by Side Diff: ui/events/devices/x11/touch_factory_x11.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/events/devices/x11/touch_factory_x11.h" 5 #include "ui/events/devices/x11/touch_factory_x11.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/extensions/XInput.h> 9 #include <X11/extensions/XInput.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 touch_events_disabled_ = cmdline->HasSwitch(switches::kTouchEvents) && 42 touch_events_disabled_ = cmdline->HasSwitch(switches::kTouchEvents) &&
43 cmdline->GetSwitchValueASCII(switches::kTouchEvents) == 43 cmdline->GetSwitchValueASCII(switches::kTouchEvents) ==
44 switches::kTouchEventsDisabled; 44 switches::kTouchEventsDisabled;
45 } 45 }
46 46
47 TouchFactory::~TouchFactory() { 47 TouchFactory::~TouchFactory() {
48 } 48 }
49 49
50 // static 50 // static
51 TouchFactory* TouchFactory::GetInstance() { 51 TouchFactory* TouchFactory::GetInstance() {
52 return Singleton<TouchFactory>::get(); 52 return base::Singleton<TouchFactory>::get();
53 } 53 }
54 54
55 // static 55 // static
56 void TouchFactory::SetTouchDeviceListFromCommandLine() { 56 void TouchFactory::SetTouchDeviceListFromCommandLine() {
57 // Get a list of pointer-devices that should be treated as touch-devices. 57 // Get a list of pointer-devices that should be treated as touch-devices.
58 // This is primarily used for testing/debugging touch-event processing when a 58 // This is primarily used for testing/debugging touch-event processing when a
59 // touch-device isn't available. 59 // touch-device isn't available.
60 std::string touch_devices = 60 std::string touch_devices =
61 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 61 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
62 switches::kTouchDevices); 62 switches::kTouchDevices);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 std::find_if(touchscreens.begin(), touchscreens.end(), 313 std::find_if(touchscreens.begin(), touchscreens.end(),
314 [device_id](const TouchscreenDevice& touchscreen) { 314 [device_id](const TouchscreenDevice& touchscreen) {
315 return touchscreen.id == device_id; 315 return touchscreen.id == device_id;
316 }); 316 });
317 // Internal displays will have a vid and pid of 0. Ignore them. 317 // Internal displays will have a vid and pid of 0. Ignore them.
318 if (it != touchscreens.end() && it->vendor_id && it->product_id) 318 if (it != touchscreens.end() && it->vendor_id && it->product_id)
319 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); 319 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id));
320 } 320 }
321 321
322 } // namespace ui 322 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/x11/touch_factory_x11.h ('k') | ui/events/gesture_detection/gesture_configuration_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698