OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
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 WEBCLIPBOARD_IMPL_H_ | |
6 #define WEBCLIPBOARD_IMPL_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "third_party/WebKit/public/platform/WebClipboard.h" | |
10 #include "ui/base/clipboard/clipboard.h" | |
11 #include "webkit/glue/webkit_glue_export.h" | |
12 | |
13 #include <string> | |
14 | |
15 namespace webkit_glue { | |
16 class ClipboardClient; | |
17 | |
18 class WEBKIT_GLUE_EXPORT WebClipboardImpl : | |
19 NON_EXPORTED_BASE(public WebKit::WebClipboard) { | |
20 public: | |
21 static std::string URLToMarkup(const WebKit::WebURL& url, | |
22 const WebKit::WebString& title); | |
23 static std::string URLToImageMarkup(const WebKit::WebURL& url, | |
24 const WebKit::WebString& title); | |
25 | |
26 explicit WebClipboardImpl(ClipboardClient* client); | |
27 | |
28 virtual ~WebClipboardImpl(); | |
29 | |
30 // WebClipboard methods: | |
31 virtual uint64 getSequenceNumber(); | |
32 virtual uint64 sequenceNumber(Buffer buffer); | |
33 virtual bool isFormatAvailable(Format format, Buffer buffer); | |
34 virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( | |
35 Buffer buffer, bool* contains_filenames); | |
36 virtual WebKit::WebString readPlainText(Buffer buffer); | |
37 virtual WebKit::WebString readHTML( | |
38 Buffer buffer, | |
39 WebKit::WebURL* source_url, | |
40 unsigned* fragment_start, | |
41 unsigned* fragment_end); | |
42 virtual WebKit::WebData readImage(Buffer buffer); | |
43 virtual WebKit::WebString readCustomData( | |
44 Buffer buffer, const WebKit::WebString& type); | |
45 virtual void writeHTML( | |
46 const WebKit::WebString& html_text, | |
47 const WebKit::WebURL& source_url, | |
48 const WebKit::WebString& plain_text, | |
49 bool write_smart_paste); | |
50 virtual void writePlainText(const WebKit::WebString& plain_text); | |
51 virtual void writeURL( | |
52 const WebKit::WebURL& url, | |
53 const WebKit::WebString& title); | |
54 virtual void writeImage( | |
55 const WebKit::WebImage& image, | |
56 const WebKit::WebURL& source_url, | |
57 const WebKit::WebString& title); | |
58 virtual void writeDataObject(const WebKit::WebDragData& data); | |
59 | |
60 private: | |
61 bool ConvertBufferType(Buffer, ui::Clipboard::Buffer*); | |
62 ClipboardClient* client_; | |
63 }; | |
64 | |
65 } // namespace webkit_glue | |
66 | |
67 #endif // WEBCLIPBOARD_IMPL_H_ | |
OLD | NEW |