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

Unified Diff: ui/views/test/x11_property_change_waiter.cc

Issue 2914103002: Remove usages of XInternAtom (Closed)
Patch Set: Address sadrul and sergeyu comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/test/x11_property_change_waiter.cc
diff --git a/ui/views/test/x11_property_change_waiter.cc b/ui/views/test/x11_property_change_waiter.cc
index c3adc55439d81a9a1f20fad6b3332b48b5c587bf..b9937b3a117d0d687bba8a52c63fbbffb800ba37 100644
--- a/ui/views/test/x11_property_change_waiter.cc
+++ b/ui/views/test/x11_property_change_waiter.cc
@@ -7,27 +7,22 @@
#include <X11/Xlib.h>
#include "base/run_loop.h"
+#include "ui/base/x/x11_util.h"
#include "ui/base/x/x11_window_event_manager.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/events/platform/scoped_event_dispatcher.h"
-#include "ui/gfx/x/x11_atom_cache.h"
namespace views {
X11PropertyChangeWaiter::X11PropertyChangeWaiter(XID window,
const char* property)
: x_window_(window), property_(property), wait_(true) {
- Display* display = gfx::GetXDisplay();
-
// Ensure that we are listening to PropertyNotify events for |window|. This
// is not the case for windows which were not created by
// DesktopWindowTreeHostX11.
x_window_events_.reset(
new ui::XScopedEventSelector(x_window_, PropertyChangeMask));
- const char* kAtomsToCache[] = { property, NULL };
- atom_cache_.reset(new ui::X11AtomCache(display, kAtomsToCache));
-
// Override the dispatcher so that we get events before
// DesktopWindowTreeHostX11 does. We must do this because
// DesktopWindowTreeHostX11 stops propagation.
@@ -61,10 +56,9 @@ bool X11PropertyChangeWaiter::CanDispatchEvent(const ui::PlatformEvent& event) {
uint32_t X11PropertyChangeWaiter::DispatchEvent(
const ui::PlatformEvent& event) {
- if (!wait_ ||
- event->type != PropertyNotify ||
+ if (!wait_ || event->type != PropertyNotify ||
event->xproperty.window != x_window_ ||
- event->xproperty.atom != atom_cache_->GetAtom(property_) ||
+ event->xproperty.atom != ui::GetAtom(property_) ||
ShouldKeepOnWaiting(event)) {
return ui::POST_DISPATCH_PERFORM_DEFAULT;
}
« no previous file with comments | « ui/views/test/x11_property_change_waiter.h ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698