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

Side by Side Diff: ui/base/x/x11_atom_cache.h

Issue 10416020: Desktop aura: Put x11 cache in aura, instead of ui/base/x/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove aura:: prefix 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/x11_atom_cache.cc ('k') | ui/base/x/x11_atom_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_X_X11_ATOM_CACHE_H_
6 #define UI_BASE_X_X11_ATOM_CACHE_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/singleton.h"
10 #include "ui/base/ui_export.h"
11
12 #include <X11/Xlib.h>
13
14 #include <map>
15
16 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
17 #undef RootWindow
18
19 namespace ui {
20
21 // Names of cached atoms that we fetch from X11AtomCache. Adding an entry here
22 // also requires adding an entry in the cc file.
23 enum AtomName {
24 ATOM_WM_DELETE_WINDOW = 0,
25 ATOM__NET_WM_MOVERESIZE,
26 ATOM__NET_WM_PING,
27 ATOM__NET_WM_PID,
28 ATOM_WM_S0,
29 ATOM__MOTIF_WM_HINTS,
30
31 ATOM_COUNT
32 };
33
34 // Pre-caches all Atoms on first use to minimize roundtrips to the X11
35 // server. Assumes that we only have a single X11 display,
36 // base::MessagePumpX::GetDefaultXDisplay().
37 class UI_EXPORT X11AtomCache {
38 public:
39 static X11AtomCache* GetInstance();
40
41 // Returns the pre-interned Atom by enum instead of string.
42 ::Atom GetAtom(AtomName name) const;
43
44 private:
45 friend struct DefaultSingletonTraits<X11AtomCache>;
46
47 // Constructor performs all interning
48 X11AtomCache();
49 ~X11AtomCache();
50
51 std::map<AtomName, ::Atom> cached_atoms_;
52
53 DISALLOW_COPY_AND_ASSIGN(X11AtomCache);
54 };
55
56 } // namespace ui
57
58 #endif // UI_BASE_X_ATOM_CACHE_H_
OLDNEW
« no previous file with comments | « ui/aura/x11_atom_cache.cc ('k') | ui/base/x/x11_atom_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698