| OLD | NEW |
| 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_CLIPBOARD_CLIPBOARD_H_ | 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // all clipboards, except on Windows. (Previous code leaks the IO thread | 206 // all clipboards, except on Windows. (Previous code leaks the IO thread |
| 207 // clipboard, so it shouldn't be a problem.) | 207 // clipboard, so it shouldn't be a problem.) |
| 208 static void DestroyClipboardForCurrentThread(); | 208 static void DestroyClipboardForCurrentThread(); |
| 209 | 209 |
| 210 // Write a bunch of objects to the system clipboard. Copies are made of the | 210 // Write a bunch of objects to the system clipboard. Copies are made of the |
| 211 // contents of |objects|. On Windows they are copied to the system clipboard. | 211 // contents of |objects|. On Windows they are copied to the system clipboard. |
| 212 // On linux they are copied into a structure owned by the Clipboard object and | 212 // On linux they are copied into a structure owned by the Clipboard object and |
| 213 // kept until the system clipboard is set again. | 213 // kept until the system clipboard is set again. |
| 214 void WriteObjects(Buffer buffer, const ObjectMap& objects); | 214 void WriteObjects(Buffer buffer, const ObjectMap& objects); |
| 215 | 215 |
| 216 // On Linux/BSD, we need to know when the clipboard is set to a URL. Most | |
| 217 // platforms don't care. | |
| 218 #if defined(OS_WIN) || defined(OS_MACOSX) \ | |
| 219 || (defined(USE_AURA) && defined(OS_CHROMEOS)) \ | |
| 220 || defined(OS_ANDROID) | |
| 221 void DidWriteURL(const std::string& utf8_text) {} | |
| 222 #else | |
| 223 void DidWriteURL(const std::string& utf8_text); | |
| 224 #endif | |
| 225 | |
| 226 // Returns a sequence number which uniquely identifies clipboard state. | 216 // Returns a sequence number which uniquely identifies clipboard state. |
| 227 // This can be used to version the data on the clipboard and determine | 217 // This can be used to version the data on the clipboard and determine |
| 228 // whether it has changed. | 218 // whether it has changed. |
| 229 uint64 GetSequenceNumber(Buffer buffer); | 219 uint64 GetSequenceNumber(Buffer buffer); |
| 230 | 220 |
| 231 // Tests whether the clipboard contains a certain format | 221 // Tests whether the clipboard contains a certain format |
| 232 bool IsFormatAvailable(const FormatType& format, Buffer buffer) const; | 222 bool IsFormatAvailable(const FormatType& format, Buffer buffer) const; |
| 233 | 223 |
| 234 // Clear the clipboard data. | 224 // Clear the clipboard data. |
| 235 void Clear(Buffer buffer); | 225 void Clear(Buffer buffer); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 class AuraX11Details; | 382 class AuraX11Details; |
| 393 scoped_ptr<AuraX11Details> aurax11_details_; | 383 scoped_ptr<AuraX11Details> aurax11_details_; |
| 394 #endif | 384 #endif |
| 395 | 385 |
| 396 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 386 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
| 397 }; | 387 }; |
| 398 | 388 |
| 399 } // namespace ui | 389 } // namespace ui |
| 400 | 390 |
| 401 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 391 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| OLD | NEW |