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