OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef UI_BASE_X_SELECTION_UTILS_H_ | 5 #ifndef UI_BASE_X_SELECTION_UTILS_H_ |
6 #define UI_BASE_X_SELECTION_UTILS_H_ | 6 #define UI_BASE_X_SELECTION_UTILS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 11 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
12 #undef RootWindow | 12 #undef RootWindow |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 | 15 |
16 #include "base/memory/ref_counted_memory.h" | 16 #include "base/memory/ref_counted_memory.h" |
17 #include "ui/base/clipboard/clipboard.h" | 17 #include "ui/base/clipboard/clipboard.h" |
18 #include "ui/base/ui_base_export.h" | 18 #include "ui/base/ui_base_export.h" |
19 #include "ui/gfx/x/x11_atom_cache.h" | |
20 | 19 |
21 namespace ui { | 20 namespace ui { |
22 class SelectionData; | 21 class SelectionData; |
23 class X11AtomCache; | |
24 | 22 |
25 extern const char kString[]; | 23 extern const char kString[]; |
26 extern const char kText[]; | 24 extern const char kText[]; |
27 extern const char kUtf8String[]; | 25 extern const char kUtf8String[]; |
28 | 26 |
29 // Returns a list of all text atoms that we handle. | 27 // Returns a list of all text atoms that we handle. |
30 UI_BASE_EXPORT std::vector< ::Atom> GetTextAtomsFrom( | 28 UI_BASE_EXPORT std::vector<::Atom> GetTextAtomsFrom(); |
31 const X11AtomCache* atom_cache); | |
32 | 29 |
33 UI_BASE_EXPORT std::vector< ::Atom> GetURLAtomsFrom( | 30 UI_BASE_EXPORT std::vector<::Atom> GetURLAtomsFrom(); |
34 const X11AtomCache* atom_cache); | |
35 | 31 |
36 UI_BASE_EXPORT std::vector< ::Atom> GetURIListAtomsFrom( | 32 UI_BASE_EXPORT std::vector<::Atom> GetURIListAtomsFrom(); |
37 const X11AtomCache* atom_cache); | |
38 | 33 |
39 // Places the intersection of |desired| and |offered| into |output|. | 34 // Places the intersection of |desired| and |offered| into |output|. |
40 UI_BASE_EXPORT void GetAtomIntersection(const std::vector< ::Atom>& desired, | 35 UI_BASE_EXPORT void GetAtomIntersection(const std::vector< ::Atom>& desired, |
41 const std::vector< ::Atom>& offered, | 36 const std::vector< ::Atom>& offered, |
42 std::vector< ::Atom>* output); | 37 std::vector< ::Atom>* output); |
43 | 38 |
44 // Takes the raw bytes of the base::string16 and copies them into |bytes|. | 39 // Takes the raw bytes of the base::string16 and copies them into |bytes|. |
45 UI_BASE_EXPORT void AddString16ToVector(const base::string16& str, | 40 UI_BASE_EXPORT void AddString16ToVector(const base::string16& str, |
46 std::vector<unsigned char>* bytes); | 41 std::vector<unsigned char>* bytes); |
47 | 42 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // guesses the character encoding of the source. | 110 // guesses the character encoding of the source. |
116 base::string16 GetHtml() const; | 111 base::string16 GetHtml() const; |
117 | 112 |
118 // Assigns the raw data to the string. | 113 // Assigns the raw data to the string. |
119 void AssignTo(std::string* result) const; | 114 void AssignTo(std::string* result) const; |
120 void AssignTo(base::string16* result) const; | 115 void AssignTo(base::string16* result) const; |
121 | 116 |
122 private: | 117 private: |
123 ::Atom type_; | 118 ::Atom type_; |
124 scoped_refptr<base::RefCountedMemory> memory_; | 119 scoped_refptr<base::RefCountedMemory> memory_; |
125 | |
126 X11AtomCache atom_cache_; | |
127 }; | 120 }; |
128 | 121 |
129 } // namespace ui | 122 } // namespace ui |
130 | 123 |
131 #endif // UI_BASE_X_SELECTION_UTILS_H_ | 124 #endif // UI_BASE_X_SELECTION_UTILS_H_ |
OLD | NEW |