| 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 <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <string> | 11 #include <string> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 13 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 14 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 15 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 16 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 17 #include "base/threading/platform_thread.h" | 19 #include "base/threading/platform_thread.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 static Clipboard* GetForCurrentThread(); | 143 static Clipboard* GetForCurrentThread(); |
| 142 | 144 |
| 143 // Destroys the clipboard for the current thread. Usually, this will clean up | 145 // Destroys the clipboard for the current thread. Usually, this will clean up |
| 144 // all clipboards, except on Windows. (Previous code leaks the IO thread | 146 // all clipboards, except on Windows. (Previous code leaks the IO thread |
| 145 // clipboard, so it shouldn't be a problem.) | 147 // clipboard, so it shouldn't be a problem.) |
| 146 static void DestroyClipboardForCurrentThread(); | 148 static void DestroyClipboardForCurrentThread(); |
| 147 | 149 |
| 148 // Returns a sequence number which uniquely identifies clipboard state. | 150 // Returns a sequence number which uniquely identifies clipboard state. |
| 149 // This can be used to version the data on the clipboard and determine | 151 // This can be used to version the data on the clipboard and determine |
| 150 // whether it has changed. | 152 // whether it has changed. |
| 151 virtual uint64 GetSequenceNumber(ClipboardType type) const = 0; | 153 virtual uint64_t GetSequenceNumber(ClipboardType type) const = 0; |
| 152 | 154 |
| 153 // Tests whether the clipboard contains a certain format | 155 // Tests whether the clipboard contains a certain format |
| 154 virtual bool IsFormatAvailable(const FormatType& format, | 156 virtual bool IsFormatAvailable(const FormatType& format, |
| 155 ClipboardType type) const = 0; | 157 ClipboardType type) const = 0; |
| 156 | 158 |
| 157 // Clear the clipboard data. | 159 // Clear the clipboard data. |
| 158 virtual void Clear(ClipboardType type) = 0; | 160 virtual void Clear(ClipboardType type) = 0; |
| 159 | 161 |
| 160 virtual void ReadAvailableTypes(ClipboardType type, | 162 virtual void ReadAvailableTypes(ClipboardType type, |
| 161 std::vector<base::string16>* types, | 163 std::vector<base::string16>* types, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 320 |
| 319 // Mutex that controls access to |g_clipboard_map|. | 321 // Mutex that controls access to |g_clipboard_map|. |
| 320 static base::LazyInstance<base::Lock>::Leaky clipboard_map_lock_; | 322 static base::LazyInstance<base::Lock>::Leaky clipboard_map_lock_; |
| 321 | 323 |
| 322 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 324 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
| 323 }; | 325 }; |
| 324 | 326 |
| 325 } // namespace ui | 327 } // namespace ui |
| 326 | 328 |
| 327 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 329 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| OLD | NEW |