Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Side by Side Diff: content/renderer/renderer_clipboard_delegate.h

Issue 574273002: Rewrite clipboard write IPC handling to be easier to understand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
6 #define CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
7
8 #include <stdint.h>
9 #include <map>
10 #include <string>
11 #include <vector>
12
13 #include "base/compiler_specific.h"
14 #include "base/macros.h"
15 #include "base/strings/string16.h"
16 #include "content/common/clipboard_format.h"
17 #include "ui/base/clipboard/clipboard_types.h"
18
19 class GURL;
20 class SkBitmap;
21
22 namespace content {
23
24 // Renderer interface to read/write from the clipboard over IPC.
25 class RendererClipboardDelegate {
26 public:
27 RendererClipboardDelegate();
28
29 uint64 GetSequenceNumber(ui::ClipboardType type);
30 bool IsFormatAvailable(ClipboardFormat format, ui::ClipboardType type);
31 void Clear(ui::ClipboardType type);
32 void ReadAvailableTypes(ui::ClipboardType type,
33 std::vector<base::string16>* types,
34 bool* contains_filenames);
35 void ReadText(ui::ClipboardType type, base::string16* result);
36 void ReadHTML(ui::ClipboardType type,
37 base::string16* markup,
38 GURL* url,
39 uint32* fragment_start,
40 uint32* fragment_end);
41 void ReadRTF(ui::ClipboardType type, std::string* result);
42 void ReadImage(ui::ClipboardType type, std::string* data);
43 void ReadCustomData(ui::ClipboardType clipboard_type,
44 const base::string16& type,
45 base::string16* data);
46
47 void WriteText(ui::ClipboardType type, const base::string16& text);
48 void WriteHTML(ui::ClipboardType type,
49 const base::string16& markup,
50 const GURL& url);
51 void WriteSmartPasteMarker(ui::ClipboardType type);
52 void WriteCustomData(ui::ClipboardType type,
53 const std::map<base::string16, base::string16>& data);
54 void WriteBookmark(ui::ClipboardType type,
55 const GURL& url,
56 const base::string16& title);
57 bool WriteImage(ui::ClipboardType type, const SkBitmap& bitmap);
58 void CommitWrite(ui::ClipboardType type);
59
60 private:
61 DISALLOW_COPY_AND_ASSIGN(RendererClipboardDelegate);
62 };
63
64 } // namespace content
65
66 #endif // CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/renderer/renderer_clipboard_client.cc ('k') | content/renderer/renderer_clipboard_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698