| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TEST_TEST_CLIPBOARD_H_ | 5 #ifndef UI_BASE_TEST_TEST_CLIPBOARD_H_ |
| 6 #define UI_BASE_TEST_TEST_CLIPBOARD_H_ | 6 #define UI_BASE_TEST_TEST_CLIPBOARD_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "ui/base/clipboard/clipboard.h" | 10 #include "ui/base/clipboard/clipboard.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 class TestClipboard : public Clipboard { | 14 class TestClipboard : public Clipboard { |
| 15 public: | 15 public: |
| 16 TestClipboard(); | 16 TestClipboard(); |
| 17 ~TestClipboard() override; | 17 ~TestClipboard() override; |
| 18 | 18 |
| 19 // Creates and associates a TestClipboard with the current thread. When no | 19 static void UseForCurrentThread(); |
| 20 // longer needed, the returned clipboard must be freed by calling | |
| 21 // Clipboard::DestroyClipboardForCurrentThread() on the same thread. | |
| 22 static Clipboard* CreateForCurrentThread(); | |
| 23 | 20 |
| 24 // Clipboard overrides. | 21 // Clipboard overrides. |
| 25 uint64 GetSequenceNumber(ClipboardType type) const override; | 22 uint64 GetSequenceNumber(ClipboardType type) const override; |
| 26 bool IsFormatAvailable(const FormatType& format, | 23 bool IsFormatAvailable(const FormatType& format, |
| 27 ClipboardType type) const override; | 24 ClipboardType type) const override; |
| 28 void Clear(ClipboardType type) override; | 25 void Clear(ClipboardType type) override; |
| 29 void ReadAvailableTypes(ClipboardType type, | 26 void ReadAvailableTypes(ClipboardType type, |
| 30 std::vector<base::string16>* types, | 27 std::vector<base::string16>* types, |
| 31 bool* contains_filenames) const override; | 28 bool* contains_filenames) const override; |
| 32 void ReadText(ClipboardType type, base::string16* result) const override; | 29 void ReadText(ClipboardType type, base::string16* result) const override; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 77 |
| 81 ClipboardType default_store_type_; | 78 ClipboardType default_store_type_; |
| 82 mutable std::map<ClipboardType, DataStore> stores_; | 79 mutable std::map<ClipboardType, DataStore> stores_; |
| 83 | 80 |
| 84 DISALLOW_COPY_AND_ASSIGN(TestClipboard); | 81 DISALLOW_COPY_AND_ASSIGN(TestClipboard); |
| 85 }; | 82 }; |
| 86 | 83 |
| 87 } // namespace ui | 84 } // namespace ui |
| 88 | 85 |
| 89 #endif // UI_BASE_TEST_TEST_CLIPBOARD_H_ | 86 #endif // UI_BASE_TEST_TEST_CLIPBOARD_H_ |
| OLD | NEW |