diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-17 14:45:48 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-17 14:45:48 +0000 |
commit | c3fac8bf704df395a6359e9da9edeca28ff34de0 (patch) | |
tree | 165cec5b2e3e50c2666d8205bbc661d17242cd21 /base/clipboard_linux.cc | |
parent | 0c4bfbd9655bc99c0fd92f6476c3c2915cca0004 (diff) | |
download | chromium_src-c3fac8bf704df395a6359e9da9edeca28ff34de0.zip chromium_src-c3fac8bf704df395a6359e9da9edeca28ff34de0.tar.gz chromium_src-c3fac8bf704df395a6359e9da9edeca28ff34de0.tar.bz2 |
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
Diffstat (limited to 'base/clipboard_linux.cc')
-rw-r--r-- | base/clipboard_linux.cc | 12 |
1 files changed, 12 insertions, 0 deletions
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 |