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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/renderer_clipboard_client.cc ('k') | content/renderer/renderer_clipboard_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_clipboard_delegate.h
diff --git a/content/renderer/renderer_clipboard_delegate.h b/content/renderer/renderer_clipboard_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef8e034fce9ba8f8513c470d72f68df13a0f23b2
--- /dev/null
+++ b/content/renderer/renderer_clipboard_delegate.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
+#define CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
+
+#include <stdint.h>
+#include <map>
+#include <string>
+#include <vector>
+
+#include "base/compiler_specific.h"
+#include "base/macros.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 {
+
+// Renderer interface to read/write from the clipboard over IPC.
+class RendererClipboardDelegate {
+ public:
+ RendererClipboardDelegate();
+
+ 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);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RendererClipboardDelegate);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_RENDERER_CLIPBOARD_DELEGATE_H_
« 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