OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 BASE_CLIPBOARD_H_ | 5 #ifndef BASE_CLIPBOARD_H_ |
6 #define BASE_CLIPBOARD_H_ | 6 #define BASE_CLIPBOARD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 #elif defined(OS_LINUX) | 186 #elif defined(OS_LINUX) |
187 // Data is stored in the |clipboard_data_| map until it is saved to the system | 187 // Data is stored in the |clipboard_data_| map until it is saved to the system |
188 // clipboard. The Store* functions save data to the |clipboard_data_| map. The | 188 // clipboard. The Store* functions save data to the |clipboard_data_| map. The |
189 // SetGtkClipboard function replaces whatever is on the system clipboard with | 189 // SetGtkClipboard function replaces whatever is on the system clipboard with |
190 // the contents of |clipboard_data_|. | 190 // the contents of |clipboard_data_|. |
191 // The Write* functions make a deep copy of the data passed to them an store | 191 // The Write* functions make a deep copy of the data passed to them an store |
192 // it in |clipboard_data_|. | 192 // it in |clipboard_data_|. |
193 | 193 |
194 // Write changes to gtk clipboard. | 194 // Write changes to gtk clipboard. |
195 void SetGtkClipboard(); | 195 void SetGtkClipboard(); |
196 // Free pointers in clipboard_data_ and clear() the map. | |
197 void FreeTargetMap(); | |
198 // Insert a mapping into clipboard_data_. | 196 // Insert a mapping into clipboard_data_. |
199 void InsertMapping(const char* key, char* data, size_t data_len); | 197 void InsertMapping(const char* key, char* data, size_t data_len); |
200 | 198 |
201 TargetMap* clipboard_data_; | 199 TargetMap* clipboard_data_; |
202 GtkClipboard* clipboard_; | 200 GtkClipboard* clipboard_; |
203 #endif | 201 #endif |
204 | 202 |
205 DISALLOW_EVIL_CONSTRUCTORS(Clipboard); | 203 DISALLOW_EVIL_CONSTRUCTORS(Clipboard); |
206 }; | 204 }; |
207 | 205 |
208 #endif // BASE_CLIPBOARD_H_ | 206 #endif // BASE_CLIPBOARD_H_ |
OLD | NEW |