| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_HTML_VIEWER_WEB_CLIPBOARD_IMPL_H_ | |
| 6 #define COMPONENTS_HTML_VIEWER_WEB_CLIPBOARD_IMPL_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/clipboard/public/interfaces/clipboard.mojom.h" | |
| 12 #include "third_party/WebKit/public/platform/WebClipboard.h" | |
| 13 | |
| 14 namespace html_viewer { | |
| 15 | |
| 16 class WebClipboardImpl : public blink::WebClipboard { | |
| 17 public: | |
| 18 WebClipboardImpl(mojo::ClipboardPtr clipboard); | |
| 19 virtual ~WebClipboardImpl(); | |
| 20 | |
| 21 // blink::WebClipboard methods: | |
| 22 uint64_t sequenceNumber(Buffer) override; | |
| 23 bool isFormatAvailable(Format, Buffer) override; | |
| 24 blink::WebVector<blink::WebString> readAvailableTypes( | |
| 25 Buffer buffer, | |
| 26 bool* contains_filenames) override; | |
| 27 blink::WebString readPlainText(Buffer buffer) override; | |
| 28 blink::WebString readHTML(Buffer buffer, | |
| 29 blink::WebURL* page_url, | |
| 30 unsigned* fragment_start, | |
| 31 unsigned* fragment_end) override; | |
| 32 // TODO(erg): readImage() | |
| 33 blink::WebString readCustomData(Buffer buffer, | |
| 34 const blink::WebString& type) override; | |
| 35 void writePlainText(const blink::WebString& plain_text) override; | |
| 36 void writeHTML(const blink::WebString& html_text, | |
| 37 const blink::WebURL& source_url, | |
| 38 const blink::WebString& plain_text, | |
| 39 bool write_smart_paste) override; | |
| 40 | |
| 41 private: | |
| 42 // Changes webkit buffers to mojo Clipboard::Types. | |
| 43 mojo::Clipboard::Type ConvertBufferType(Buffer buffer); | |
| 44 | |
| 45 mojo::ClipboardPtr clipboard_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(WebClipboardImpl); | |
| 48 }; | |
| 49 | |
| 50 } // namespace html_viewer | |
| 51 | |
| 52 #endif // COMPONENTS_HTML_VIEWER_WEB_CLIPBOARD_IMPL_H_ | |
| OLD | NEW |