From c3fac8bf704df395a6359e9da9edeca28ff34de0 Mon Sep 17 00:00:00 2001 From: "pinkerton@google.com" Date: Mon, 17 Nov 2008 14:45:48 +0000 Subject: Implement the WebSmartPaste pasteboard type on Mac, stub it out on Linux, remove the platform ifdefs in common code. Review URL: http://codereview.chromium.org/10955 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5559 0039d316-1c4b-4281-b951-d872f2087c98 --- base/clipboard_linux.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'base/clipboard_linux.cc') diff --git a/base/clipboard_linux.cc b/base/clipboard_linux.cc index 427ec13..5906319 100644 --- a/base/clipboard_linux.cc +++ b/base/clipboard_linux.cc @@ -15,6 +15,7 @@ namespace { static const char* kMimeHtml = "text/html"; static const char* kMimeText = "text/plain"; +static const char* kMimeWebkitSmartPaste = "chrome-internal/webkit-paste"; // GtkClipboardGetFunc callback. // GTK will call this when an application wants data we copied to the clipboard. @@ -140,6 +141,12 @@ void Clipboard::WriteHTML(const char* markup_data, InsertMapping(kMimeHtml, data, markup_len); } +// Write an extra flavor that signifies WebKit was the last to modify the +// pasteboard. This flavor has no data. +void Clipboard::WriteWebSmartPaste() { + InsertMapping(kMimeWebkitSmartPaste, NULL, 0); +} + // We do not use gtk_clipboard_wait_is_target_available because of // a bug with the gtk clipboard. It caches the available targets // and does not always refresh the cache when it is appropriate. @@ -227,6 +234,11 @@ Clipboard::FormatType Clipboard::GetHtmlFormatType() { return gdk_atom_intern(kMimeHtml, false); } +// static +Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { + return gdk_atom_intern(kMimeWebkitSmartPaste, false); +} + // Insert the key/value pair in the clipboard_data structure. If // the mapping already exists, it frees the associated data. Don't worry // about double freeing because if the same key is inserted into the -- cgit v1.1