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

Side by Side Diff: ui/events/platform/x11/x11_event_source.cc

Issue 2924343002: Move ui::GetAtom to gfx::GetAtom (Closed)
Patch Set: fix CrOs build Created 3 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/platform/x11/x11_event_source.h" 5 #include "ui/events/platform/x11/x11_event_source.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/XKBlib.h> 8 #include <X11/XKBlib.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 BlockOnWindowStructureEvent(window, MapNotify); 150 BlockOnWindowStructureEvent(window, MapNotify);
151 } 151 }
152 152
153 Time X11EventSource::GetCurrentServerTime() { 153 Time X11EventSource::GetCurrentServerTime() {
154 DCHECK(display_); 154 DCHECK(display_);
155 155
156 if (!dummy_initialized_) { 156 if (!dummy_initialized_) {
157 // Create a new Window and Atom that will be used for the property change. 157 // Create a new Window and Atom that will be used for the property change.
158 dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_), 158 dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_),
159 0, 0, 1, 1, 0, 0, 0); 159 0, 0, 1, 1, 0, 0, 0);
160 dummy_atom_ = X11AtomCache::GetInstance()->GetAtom("CHROMIUM_TIMESTAMP"); 160 dummy_atom_ = gfx::GetAtom("CHROMIUM_TIMESTAMP");
161 dummy_window_events_.reset( 161 dummy_window_events_.reset(
162 new XScopedEventSelector(dummy_window_, PropertyChangeMask)); 162 new XScopedEventSelector(dummy_window_, PropertyChangeMask));
163 dummy_initialized_ = true; 163 dummy_initialized_ = true;
164 } 164 }
165 165
166 base::TimeTicks start = base::TimeTicks::Now(); 166 base::TimeTicks start = base::TimeTicks::Now();
167 167
168 // Make a no-op property change on |dummy_window_|. 168 // Make a no-op property change on |dummy_window_|.
169 XChangeProperty(display_, dummy_window_, dummy_atom_, XA_STRING, 8, 169 XChangeProperty(display_, dummy_window_, dummy_atom_, XA_STRING, 8,
170 PropModeAppend, nullptr, 0); 170 PropModeAppend, nullptr, 0);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 void X11EventSource::OnDispatcherListChanged() { 296 void X11EventSource::OnDispatcherListChanged() {
297 if (!hotplug_event_handler_) { 297 if (!hotplug_event_handler_) {
298 hotplug_event_handler_.reset(new X11HotplugEventHandler()); 298 hotplug_event_handler_.reset(new X11HotplugEventHandler());
299 // Force the initial device query to have an update list of active devices. 299 // Force the initial device query to have an update list of active devices.
300 hotplug_event_handler_->OnHotplugEvent(); 300 hotplug_event_handler_->OnHotplugEvent();
301 } 301 }
302 } 302 }
303 303
304 } // namespace ui 304 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.cc ('k') | ui/events/platform/x11/x11_hotplug_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698