OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 WEBCLIPBOARD_IMPL_H_ | 5 #ifndef WEBCLIPBOARD_IMPL_H_ |
6 #define WEBCLIPBOARD_IMPL_H_ | 6 #define WEBCLIPBOARD_IMPL_H_ |
7 | 7 |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebClipboard.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebClipboard.h" |
9 #include "ui/base/clipboard/clipboard.h" | 9 #include "ui/base/clipboard/clipboard.h" |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 namespace webkit_glue { | 13 namespace webkit_glue { |
| 14 class ClipboardClient; |
14 | 15 |
15 class WebClipboardImpl : public WebKit::WebClipboard { | 16 class WebClipboardImpl : public WebKit::WebClipboard { |
16 public: | 17 public: |
17 static std::string URLToMarkup(const WebKit::WebURL& url, | 18 static std::string URLToMarkup(const WebKit::WebURL& url, |
18 const WebKit::WebString& title); | 19 const WebKit::WebString& title); |
19 static std::string URLToImageMarkup(const WebKit::WebURL& url, | 20 static std::string URLToImageMarkup(const WebKit::WebURL& url, |
20 const WebKit::WebString& title); | 21 const WebKit::WebString& title); |
21 | 22 |
| 23 explicit WebClipboardImpl(ClipboardClient* client); |
| 24 |
22 virtual ~WebClipboardImpl(); | 25 virtual ~WebClipboardImpl(); |
23 | 26 |
24 // WebClipboard methods: | 27 // WebClipboard methods: |
25 virtual uint64 getSequenceNumber(); | 28 virtual uint64 getSequenceNumber(); |
26 virtual uint64 sequenceNumber(Buffer buffer); | 29 virtual uint64 sequenceNumber(Buffer buffer); |
27 virtual bool isFormatAvailable(Format format, Buffer buffer); | 30 virtual bool isFormatAvailable(Format format, Buffer buffer); |
28 virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( | 31 virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( |
29 Buffer buffer, bool* contains_filenames); | 32 Buffer buffer, bool* contains_filenames); |
30 virtual WebKit::WebString readPlainText(Buffer buffer); | 33 virtual WebKit::WebString readPlainText(Buffer buffer); |
31 virtual WebKit::WebString readHTML( | 34 virtual WebKit::WebString readHTML( |
(...skipping 12 matching lines...) Expand all Loading... |
44 const WebKit::WebURL& url, | 47 const WebKit::WebURL& url, |
45 const WebKit::WebString& title); | 48 const WebKit::WebString& title); |
46 virtual void writeImage( | 49 virtual void writeImage( |
47 const WebKit::WebImage& image, | 50 const WebKit::WebImage& image, |
48 const WebKit::WebURL& source_url, | 51 const WebKit::WebURL& source_url, |
49 const WebKit::WebString& title); | 52 const WebKit::WebString& title); |
50 virtual void writeDataObject(const WebKit::WebDragData& data); | 53 virtual void writeDataObject(const WebKit::WebDragData& data); |
51 | 54 |
52 private: | 55 private: |
53 bool ConvertBufferType(Buffer, ui::Clipboard::Buffer*); | 56 bool ConvertBufferType(Buffer, ui::Clipboard::Buffer*); |
| 57 ClipboardClient* client_; |
54 }; | 58 }; |
55 | 59 |
56 } // namespace webkit_glue | 60 } // namespace webkit_glue |
57 | 61 |
58 #endif // WEBCLIPBOARD_IMPL_H_ | 62 #endif // WEBCLIPBOARD_IMPL_H_ |
OLD | NEW |