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.
5 #ifndef MOJO_SERVICES_HTML_VIEWER_WEBCLIPBOARD_IMPL_H_
6 #define MOJO_SERVICES_HTML_VIEWER_WEBCLIPBOARD_IMPL_H_
8 #include "mojo/services/clipboard/public/interfaces/clipboard.mojom.h"
9 #include "third_party/WebKit/public/platform/WebClipboard.h"
11 namespace html_viewer
{
13 class WebClipboardImpl
: public blink::WebClipboard
{
15 WebClipboardImpl(mojo::ClipboardPtr clipboard
);
16 virtual ~WebClipboardImpl();
18 // blink::WebClipboard methods:
19 virtual uint64_t sequenceNumber(Buffer
);
20 virtual bool isFormatAvailable(Format
, Buffer
);
21 virtual blink::WebVector
<blink::WebString
> readAvailableTypes(
23 bool* containsFilenames
);
24 virtual blink::WebString
readPlainText(Buffer
);
25 virtual blink::WebString
readHTML(Buffer buffer
,
26 blink::WebURL
* pageURL
,
27 unsigned* fragmentStart
,
28 unsigned* fragmentEnd
);
29 // TODO(erg): readImage()
30 virtual blink::WebString
readCustomData(Buffer
, const blink::WebString
& type
);
31 virtual void writePlainText(const blink::WebString
&);
32 virtual void writeHTML(const blink::WebString
& htmlText
,
34 const blink::WebString
& plainText
,
35 bool writeSmartPaste
);
38 // Changes webkit buffers to mojo Clipboard::Types.
39 mojo::Clipboard::Type
ConvertBufferType(Buffer buffer
);
41 mojo::ClipboardPtr clipboard_
;
43 DISALLOW_COPY_AND_ASSIGN(WebClipboardImpl
);
46 } // namespace html_viewer
48 #endif // MOJO_SERVICES_HTML_VIEWER_WEBCLIPBOARD_IMPL_H_