OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_ |
6 #define CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_ | 6 #define CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "content/common/clipboard_format.h" | 16 #include "content/common/clipboard_format.h" |
17 #include "ui/base/clipboard/clipboard_types.h" | 17 #include "ui/base/clipboard/clipboard_types.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 class SkBitmap; | 20 class SkBitmap; |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 // Renderer interface to read/write from the clipboard over IPC. | 24 // Renderer interface to read/write from the clipboard over IPC. |
25 class RendererClipboardDelegate { | 25 class RendererClipboardDelegate { |
26 public: | 26 public: |
27 RendererClipboardDelegate(); | 27 RendererClipboardDelegate(); |
28 | 28 |
29 uint64 GetSequenceNumber(ui::ClipboardType type); | 29 uint64_t GetSequenceNumber(ui::ClipboardType type); |
30 bool IsFormatAvailable(ClipboardFormat format, ui::ClipboardType type); | 30 bool IsFormatAvailable(ClipboardFormat format, ui::ClipboardType type); |
31 void Clear(ui::ClipboardType type); | 31 void Clear(ui::ClipboardType type); |
32 void ReadAvailableTypes(ui::ClipboardType type, | 32 void ReadAvailableTypes(ui::ClipboardType type, |
33 std::vector<base::string16>* types, | 33 std::vector<base::string16>* types, |
34 bool* contains_filenames); | 34 bool* contains_filenames); |
35 void ReadText(ui::ClipboardType type, base::string16* result); | 35 void ReadText(ui::ClipboardType type, base::string16* result); |
36 void ReadHTML(ui::ClipboardType type, | 36 void ReadHTML(ui::ClipboardType type, |
37 base::string16* markup, | 37 base::string16* markup, |
38 GURL* url, | 38 GURL* url, |
39 uint32* fragment_start, | 39 uint32_t* fragment_start, |
40 uint32* fragment_end); | 40 uint32_t* fragment_end); |
41 void ReadRTF(ui::ClipboardType type, std::string* result); | 41 void ReadRTF(ui::ClipboardType type, std::string* result); |
42 void ReadImage(ui::ClipboardType type, std::string* data); | 42 void ReadImage(ui::ClipboardType type, std::string* data); |
43 void ReadCustomData(ui::ClipboardType clipboard_type, | 43 void ReadCustomData(ui::ClipboardType clipboard_type, |
44 const base::string16& type, | 44 const base::string16& type, |
45 base::string16* data); | 45 base::string16* data); |
46 | 46 |
47 void WriteText(ui::ClipboardType type, const base::string16& text); | 47 void WriteText(ui::ClipboardType type, const base::string16& text); |
48 void WriteHTML(ui::ClipboardType type, | 48 void WriteHTML(ui::ClipboardType type, |
49 const base::string16& markup, | 49 const base::string16& markup, |
50 const GURL& url); | 50 const GURL& url); |
51 void WriteSmartPasteMarker(ui::ClipboardType type); | 51 void WriteSmartPasteMarker(ui::ClipboardType type); |
52 void WriteCustomData(ui::ClipboardType type, | 52 void WriteCustomData(ui::ClipboardType type, |
53 const std::map<base::string16, base::string16>& data); | 53 const std::map<base::string16, base::string16>& data); |
54 void WriteBookmark(ui::ClipboardType type, | 54 void WriteBookmark(ui::ClipboardType type, |
55 const GURL& url, | 55 const GURL& url, |
56 const base::string16& title); | 56 const base::string16& title); |
57 bool WriteImage(ui::ClipboardType type, const SkBitmap& bitmap); | 57 bool WriteImage(ui::ClipboardType type, const SkBitmap& bitmap); |
58 void CommitWrite(ui::ClipboardType type); | 58 void CommitWrite(ui::ClipboardType type); |
59 | 59 |
60 private: | 60 private: |
61 DISALLOW_COPY_AND_ASSIGN(RendererClipboardDelegate); | 61 DISALLOW_COPY_AND_ASSIGN(RendererClipboardDelegate); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace content | 64 } // namespace content |
65 | 65 |
66 #endif // CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_ | 66 #endif // CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_ |
OLD | NEW |