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

Unified Diff: ui/base/x/x11_atom_cache.cc

Issue 10381063: Aura/ash split: Don't use X11 window borders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Part 2: Patch minimization and puts event processing in X11WindowEventFilter. Created 8 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/base/x/x11_atom_cache.cc
diff --git a/ui/base/x/x11_atom_cache.cc b/ui/base/x/x11_atom_cache.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7706eda77b797ae69a2977047d82d11f5a0e604a
--- /dev/null
+++ b/ui/base/x/x11_atom_cache.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/x/x11_atom_cache.h"
+
+#include <X11/Xatom.h>
+
+#include "base/message_pump_x.h"
+
+namespace {
+
+// A list of atoms that we'll intern on host creation to save roundtrips to the
+// X11 server. Must be kept in sync with AtomCache::AtomName
Daniel Erat 2012/05/15 20:59:41 This makes me nervous (especially combined with no
Elliot Glaysher 2012/05/15 21:56:32 Done.
+const char* kAtomList[] = {
+ "WM_DELETE_WINDOW",
+ "_NET_WM_MOVERESIZE",
+ "_NET_WM_PING",
+ "_NET_WM_PID",
+ "WM_S0",
+ "_MOTIF_WM_HINTS"
+};
+
+} // namespace
+
+namespace ui {
+
+X11AtomCache* X11AtomCache::GetInstance() {
+ return Singleton<X11AtomCache>::get();
+}
+
+::Atom X11AtomCache::GetAtom(AtomName name) const {
+ return cached_atoms_[name];
+}
+
+X11AtomCache::X11AtomCache() {
+ // Grab all the atoms we need now to minimize roundtrips to the X11 server.
+ XInternAtoms(base::MessagePumpX::GetDefaultXDisplay(),
+ const_cast<char**>(kAtomList), ATOM_COUNT, False,
+ cached_atoms_);
+}
+
+X11AtomCache::~X11AtomCache() {}
+
+} // namespace ui
+
+
« no previous file with comments | « ui/base/x/x11_atom_cache.h ('k') | ui/ui.gyp » ('j') | ui/views/widget/x11_window_event_filter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698