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

Unified Diff: content/renderer/renderer_clipboard_client.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: . Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/renderer_clipboard_client.h
diff --git a/content/renderer/renderer_clipboard_client.h b/content/renderer/renderer_clipboard_client.h
index ebf46ad75d3015607544a4e6891d1bfeec6a8400..6405bd3faecae3252dbd7e49537762bd0468ccba 100644
--- a/content/renderer/renderer_clipboard_client.h
+++ b/content/renderer/renderer_clipboard_client.h
@@ -5,38 +5,56 @@
#ifndef CONTENT_RENDERER_RENDERER_CLIPBOARD_CLIENT_H_
#define CONTENT_RENDERER_RENDERER_CLIPBOARD_CLIENT_H_
+#include <stdint.h>
+#include <map>
+#include <string>
+#include <vector>
+
#include "base/compiler_specific.h"
-#include "content/renderer/clipboard_client.h"
+#include "base/strings/string16.h"
+#include "content/common/clipboard_format.h"
+#include "ui/base/clipboard/clipboard_types.h"
+
+class GURL;
+class SkBitmap;
namespace content {
-// An implementation of ClipboardClient that gets and sends data over IPC.
-class RendererClipboardClient : public ClipboardClient {
+// Renderer interface to read/write from the clipboard over IPC.
+class RendererClipboardClient {
public:
RendererClipboardClient();
- virtual ~RendererClipboardClient();
-
- virtual ui::Clipboard* GetClipboard() OVERRIDE;
- virtual uint64 GetSequenceNumber(ui::ClipboardType type) OVERRIDE;
- virtual bool IsFormatAvailable(ClipboardFormat format,
- ui::ClipboardType type) OVERRIDE;
- virtual void Clear(ui::ClipboardType type) OVERRIDE;
- virtual void ReadAvailableTypes(ui::ClipboardType type,
- std::vector<base::string16>* types,
- bool* contains_filenames) OVERRIDE;
- virtual void ReadText(ui::ClipboardType type,
- base::string16* result) OVERRIDE;
- virtual void ReadHTML(ui::ClipboardType type,
- base::string16* markup,
- GURL* url,
- uint32* fragment_start,
- uint32* fragment_end) OVERRIDE;
- virtual void ReadRTF(ui::ClipboardType type, std::string* result) OVERRIDE;
- virtual void ReadImage(ui::ClipboardType type, std::string* data) OVERRIDE;
- virtual void ReadCustomData(ui::ClipboardType clipboard_type,
- const base::string16& type,
- base::string16* data) OVERRIDE;
- virtual WriteContext* CreateWriteContext() OVERRIDE;
+
+ uint64 GetSequenceNumber(ui::ClipboardType type);
+ bool IsFormatAvailable(ClipboardFormat format, ui::ClipboardType type);
+ void Clear(ui::ClipboardType type);
+ void ReadAvailableTypes(ui::ClipboardType type,
+ std::vector<base::string16>* types,
+ bool* contains_filenames);
+ void ReadText(ui::ClipboardType type, base::string16* result);
+ void ReadHTML(ui::ClipboardType type,
+ base::string16* markup,
+ GURL* url,
+ uint32* fragment_start,
+ uint32* fragment_end);
+ void ReadRTF(ui::ClipboardType type, std::string* result);
+ void ReadImage(ui::ClipboardType type, std::string* data);
+ void ReadCustomData(ui::ClipboardType clipboard_type,
+ const base::string16& type,
+ base::string16* data);
+
+ void WriteText(ui::ClipboardType type, const base::string16& text);
+ void WriteHTML(ui::ClipboardType type,
+ const base::string16& markup,
+ const GURL& url);
+ void WriteSmartPasteMarker(ui::ClipboardType type);
+ void WriteCustomData(ui::ClipboardType type,
+ const std::map<base::string16, base::string16>& data);
+ void WriteBookmark(ui::ClipboardType type,
+ const GURL& url,
+ const base::string16& title);
+ bool WriteImage(ui::ClipboardType type, const SkBitmap& bitmap);
+ void CommitWrite(ui::ClipboardType type);
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698