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

Side by Side Diff: ui/base/x/events_x.cc

Issue 23622035: x11: Prefer using ui::GetXDisplay() over getting the Display from the X11 message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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/base/events/event_constants.h" 5 #include "ui/base/events/event_constants.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <X11/extensions/XInput.h> 8 #include <X11/extensions/XInput.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 double GetTouchParamFromXEvent(XEvent* xev, 254 double GetTouchParamFromXEvent(XEvent* xev,
255 ui::DeviceDataManager::DataType val, 255 ui::DeviceDataManager::DataType val,
256 double default_value) { 256 double default_value) {
257 ui::DeviceDataManager::GetInstance()->GetEventData( 257 ui::DeviceDataManager::GetInstance()->GetEventData(
258 *xev, val, &default_value); 258 *xev, val, &default_value);
259 return default_value; 259 return default_value;
260 } 260 }
261 261
262 Atom GetNoopEventAtom() { 262 Atom GetNoopEventAtom() {
263 return XInternAtom( 263 return XInternAtom(
264 base::MessagePumpX11::GetDefaultXDisplay(), 264 ui::GetXDisplay(),
265 "noop", False); 265 "noop", False);
oshima 2013/09/17 15:05:10 ditto
sadrul 2013/09/17 15:28:44 Done.
266 } 266 }
267 267
268 } // namespace 268 } // namespace
269 269
270 namespace ui { 270 namespace ui {
271 271
272 void UpdateDeviceList() { 272 void UpdateDeviceList() {
273 Display* display = GetXDisplay(); 273 Display* display = GetXDisplay();
274 DeviceListCacheX::GetInstance()->UpdateDeviceList(display); 274 DeviceListCacheX::GetInstance()->UpdateDeviceList(display);
275 TouchFactory::GetInstance()->UpdateDeviceList(display); 275 TouchFactory::GetInstance()->UpdateDeviceList(display);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 noop->xclient.format = 8; 748 noop->xclient.format = 8;
749 DCHECK(!noop->xclient.display); 749 DCHECK(!noop->xclient.display);
750 } 750 }
751 // Make sure we use atom from current xdisplay, which may 751 // Make sure we use atom from current xdisplay, which may
752 // change during the test. 752 // change during the test.
753 noop->xclient.message_type = GetNoopEventAtom(); 753 noop->xclient.message_type = GetNoopEventAtom();
754 return noop; 754 return noop;
755 } 755 }
756 756
757 } // namespace ui 757 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698