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

Side by Side Diff: ui/base/dragdrop/os_exchange_data_provider_aurax11.h

Issue 2914103002: Remove usages of XInternAtom (Closed)
Patch Set: Address sadrul and sergeyu comments Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_ 5 #ifndef UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_
6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_ 6 #define UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_
7 7
8 #include <stdint.h> 8 #include <stdint.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/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/pickle.h" 18 #include "base/pickle.h"
19 #include "ui/base/dragdrop/os_exchange_data.h" 19 #include "ui/base/dragdrop/os_exchange_data.h"
20 #include "ui/base/x/selection_owner.h" 20 #include "ui/base/x/selection_owner.h"
21 #include "ui/base/x/selection_requestor.h" 21 #include "ui/base/x/selection_requestor.h"
22 #include "ui/base/x/selection_utils.h" 22 #include "ui/base/x/selection_utils.h"
23 #include "ui/events/platform/platform_event_dispatcher.h" 23 #include "ui/events/platform/platform_event_dispatcher.h"
24 #include "ui/gfx/geometry/vector2d.h" 24 #include "ui/gfx/geometry/vector2d.h"
25 #include "ui/gfx/image/image_skia.h" 25 #include "ui/gfx/image/image_skia.h"
26 #include "ui/gfx/x/x11_atom_cache.h"
27 #include "url/gurl.h" 26 #include "url/gurl.h"
28 27
29 namespace ui { 28 namespace ui {
30 29
31 class Clipboard; 30 class Clipboard;
32 class OSExchangeDataProviderAuraX11Test; 31 class OSExchangeDataProviderAuraX11Test;
33 32
34 // OSExchangeData::Provider implementation for aura on linux. 33 // OSExchangeData::Provider implementation for aura on linux.
35 class UI_BASE_EXPORT OSExchangeDataProviderAuraX11 34 class UI_BASE_EXPORT OSExchangeDataProviderAuraX11
36 : public OSExchangeData::Provider, 35 : public OSExchangeData::Provider,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // In X11, because the IPC parts of drag operations are implemented by 121 // In X11, because the IPC parts of drag operations are implemented by
123 // XSelection, we require an x11 window to receive drag messages on. The 122 // XSelection, we require an x11 window to receive drag messages on. The
124 // OSExchangeDataProvider system is modeled on the Windows implementation, 123 // OSExchangeDataProvider system is modeled on the Windows implementation,
125 // which does not require a window. We only sometimes have a valid window 124 // which does not require a window. We only sometimes have a valid window
126 // available (in the case of drag receiving). Other times, we need to create 125 // available (in the case of drag receiving). Other times, we need to create
127 // our own xwindow just to receive events on it. 126 // our own xwindow just to receive events on it.
128 const bool own_window_; 127 const bool own_window_;
129 128
130 ::Window x_window_; 129 ::Window x_window_;
131 130
132 X11AtomCache atom_cache_;
133
134 // A representation of data. This is either passed to us from the other 131 // A representation of data. This is either passed to us from the other
135 // process, or built up through a sequence of Set*() calls. It can be passed 132 // process, or built up through a sequence of Set*() calls. It can be passed
136 // to |selection_owner_| when we take the selection. 133 // to |selection_owner_| when we take the selection.
137 SelectionFormatMap format_map_; 134 SelectionFormatMap format_map_;
138 135
139 // Auxilary data for the X Direct Save protocol. 136 // Auxilary data for the X Direct Save protocol.
140 base::FilePath file_contents_name_; 137 base::FilePath file_contents_name_;
141 138
142 // Takes a snapshot of |format_map_| and offers it to other windows. 139 // Takes a snapshot of |format_map_| and offers it to other windows.
143 mutable SelectionOwner selection_owner_; 140 mutable SelectionOwner selection_owner_;
144 141
145 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAuraX11); 142 DISALLOW_COPY_AND_ASSIGN(OSExchangeDataProviderAuraX11);
146 }; 143 };
147 144
148 } // namespace ui 145 } // namespace ui
149 146
150 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_ 147 #endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_PROVIDER_AURAX11_H_
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_aurax11.cc ('k') | ui/base/dragdrop/os_exchange_data_provider_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698