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

Side by Side Diff: ui/aura/x11_atom_cache.h

Issue 10829341: Desktop aura: Use the X11 clipboard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix MessageLoop ordering in tests. Created 8 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
« no previous file with comments | « ui/aura/root_window_host_linux.h ('k') | ui/aura/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_AURA_X11_ATOM_CACHE_H_
6 #define UI_AURA_X11_ATOM_CACHE_H_
7
8 #include "base/basictypes.h"
9 #include "ui/aura/aura_export.h"
10
11 #include <X11/Xlib.h>
12
13 #include <map>
14 #include <string>
15
16 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
17 #undef RootWindow
18
19 namespace aura {
20
21 // Pre-caches all Atoms on first use to minimize roundtrips to the X11
22 // server. Assumes that we only have a single X11 display,
23 // base::MessagePumpX::GetDefaultXDisplay().
24 class AURA_EXPORT X11AtomCache {
25 public:
26 // Preinterns the NULL terminated list of string |to_cache_ on |xdisplay|.
27 X11AtomCache(Display* xdisplay, const char** to_cache);
28 ~X11AtomCache();
29
30 // Returns the pre-interned Atom without having to go to the x server.
31 ::Atom GetAtom(const char*) const;
32
33 private:
34 Display* xdisplay_;
35
36 std::map<std::string, ::Atom> cached_atoms_;
37
38 DISALLOW_COPY_AND_ASSIGN(X11AtomCache);
39 };
40
41 } // namespace aura
42
43 #endif // UI_AURA_ATOM_CACHE_H_
OLDNEW
« no previous file with comments | « ui/aura/root_window_host_linux.h ('k') | ui/aura/x11_atom_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698