[email protected] | 3d4c45f | 2012-02-29 07:07:23 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_RENDERER_RENDERER_CLIPBOARD_CLIENT_H_ |
| 6 | #define CONTENT_RENDERER_RENDERER_CLIPBOARD_CLIENT_H_ |
| 7 | |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 8 | #include "base/compiler_specific.h" |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 9 | #include "webkit/glue/clipboard_client.h" |
| 10 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 11 | namespace content { |
| 12 | |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 13 | // An implementation of ClipboardClient that gets and sends data over IPC. |
| 14 | class RendererClipboardClient : public webkit_glue::ClipboardClient { |
| 15 | public: |
| 16 | RendererClipboardClient(); |
| 17 | virtual ~RendererClipboardClient(); |
| 18 | |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 19 | virtual ui::Clipboard* GetClipboard() OVERRIDE; |
| 20 | virtual uint64 GetSequenceNumber(ui::Clipboard::Buffer buffer) OVERRIDE; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 21 | virtual bool IsFormatAvailable(const ui::Clipboard::FormatType& format, |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 22 | ui::Clipboard::Buffer buffer) OVERRIDE; |
[email protected] | 3d4c45f | 2012-02-29 07:07:23 | [diff] [blame] | 23 | virtual void Clear(ui::Clipboard::Buffer buffer) OVERRIDE; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 24 | virtual void ReadAvailableTypes(ui::Clipboard::Buffer buffer, |
| 25 | std::vector<string16>* types, |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 26 | bool* contains_filenames) OVERRIDE; |
| 27 | virtual void ReadText(ui::Clipboard::Buffer buffer, |
| 28 | string16* result) OVERRIDE; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 29 | virtual void ReadAsciiText(ui::Clipboard::Buffer buffer, |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 30 | std::string* result) OVERRIDE; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 31 | virtual void ReadHTML(ui::Clipboard::Buffer buffer, string16* markup, |
| 32 | GURL* url, uint32* fragment_start, |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 33 | uint32* fragment_end) OVERRIDE; |
[email protected] | 4dfb8f00 | 2012-04-02 22:10:05 | [diff] [blame] | 34 | virtual void ReadRTF(ui::Clipboard::Buffer buffer, |
| 35 | std::string* result) OVERRIDE; |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 36 | virtual void ReadImage(ui::Clipboard::Buffer buffer, |
| 37 | std::string* data) OVERRIDE; |
[email protected] | c6562f4 | 2011-12-04 06:19:37 | [diff] [blame] | 38 | virtual void ReadCustomData(ui::Clipboard::Buffer buffer, |
| 39 | const string16& type, |
| 40 | string16* data) OVERRIDE; |
[email protected] | a1686e27 | 2012-11-01 23:39:34 | [diff] [blame] | 41 | virtual void ReadData(const ui::Clipboard::FormatType& format, |
| 42 | std::string* data) OVERRIDE; |
[email protected] | 5d536b8 | 2011-11-28 20:00:01 | [diff] [blame] | 43 | virtual WriteContext* CreateWriteContext() OVERRIDE; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 44 | }; |
| 45 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 46 | } // namespace content |
| 47 | |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 48 | #endif // CONTENT_RENDERER_RENDERER_CLIPBOARD_CLIENT_H_ |