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

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

Issue 23943010: Revert 223621 "x11: Prefer using ui::GetXDisplay() over getting ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 253
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(ui::GetXDisplay(), "noop", False); 263 return XInternAtom(
264 base::MessagePumpX11::GetDefaultXDisplay(),
265 "noop", False);
264 } 266 }
265 267
266 } // namespace 268 } // namespace
267 269
268 namespace ui { 270 namespace ui {
269 271
270 void UpdateDeviceList() { 272 void UpdateDeviceList() {
271 Display* display = GetXDisplay(); 273 Display* display = GetXDisplay();
272 DeviceListCacheX::GetInstance()->UpdateDeviceList(display); 274 DeviceListCacheX::GetInstance()->UpdateDeviceList(display);
273 TouchFactory::GetInstance()->UpdateDeviceList(display); 275 TouchFactory::GetInstance()->UpdateDeviceList(display);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 noop->xclient.format = 8; 748 noop->xclient.format = 8;
747 DCHECK(!noop->xclient.display); 749 DCHECK(!noop->xclient.display);
748 } 750 }
749 // Make sure we use atom from current xdisplay, which may 751 // Make sure we use atom from current xdisplay, which may
750 // change during the test. 752 // change during the test.
751 noop->xclient.message_type = GetNoopEventAtom(); 753 noop->xclient.message_type = GetNoopEventAtom();
752 return noop; 754 return noop;
753 } 755 }
754 756
755 } // namespace ui 757 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698