[email protected] | fbf7541 | 2012-01-07 01:26:52 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 2dfeaf9 | 2011-01-10 21:08:21 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 4 | |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 5 | #include "webkit/glue/webclipboard_impl.h" |
| 6 | |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 7 | #include "base/logging.h" |
[email protected] | 2ffbb48 | 2011-12-05 23:41:17 | [diff] [blame] | 8 | #include "base/pickle.h" |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 9 | #include "base/string_util.h" |
[email protected] | b1e4eb50 | 2010-03-07 20:53:33 | [diff] [blame] | 10 | #include "base/utf_string_conversions.h" |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 11 | #include "googleurl/src/gurl.h" |
| 12 | #include "net/base/escape.h" |
[email protected] | 445852d | 2013-01-15 16:55:39 | [diff] [blame] | 13 | #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
| 14 | #include "third_party/WebKit/Source/Platform/chromium/public/WebDragData.h" |
| 15 | #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h" |
| 16 | #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 17 | #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| 18 | #include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h" |
| 19 | #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
[email protected] | 8973f52 | 2009-07-03 05:58:45 | [diff] [blame] | 20 | #include "third_party/skia/include/core/SkBitmap.h" |
[email protected] | 2dfeaf9 | 2011-01-10 21:08:21 | [diff] [blame] | 21 | #include "ui/base/clipboard/clipboard.h" |
[email protected] | 2ffbb48 | 2011-12-05 23:41:17 | [diff] [blame] | 22 | #include "ui/base/clipboard/custom_data_helper.h" |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 23 | #include "webkit/glue/scoped_clipboard_writer_glue.h" |
[email protected] | 2ffbb48 | 2011-12-05 23:41:17 | [diff] [blame] | 24 | #include "webkit/glue/webdropdata.h" |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 25 | #include "webkit/glue/webkit_glue.h" |
| 26 | |
| 27 | using WebKit::WebClipboard; |
[email protected] | 3d4a691 | 2011-03-15 20:56:19 | [diff] [blame] | 28 | using WebKit::WebData; |
[email protected] | 3f031829 | 2011-11-18 21:49:00 | [diff] [blame] | 29 | using WebKit::WebDragData; |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 30 | using WebKit::WebImage; |
| 31 | using WebKit::WebString; |
| 32 | using WebKit::WebURL; |
[email protected] | 97c2c03 | 2010-07-07 22:43:41 | [diff] [blame] | 33 | using WebKit::WebVector; |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 34 | |
| 35 | namespace webkit_glue { |
| 36 | |
[email protected] | b9a0b1b3 | 2009-03-30 23:09:37 | [diff] [blame] | 37 | // Static |
| 38 | std::string WebClipboardImpl::URLToMarkup(const WebURL& url, |
| 39 | const WebString& title) { |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 40 | std::string markup("<a href=\""); |
| 41 | markup.append(url.spec()); |
| 42 | markup.append("\">"); |
| 43 | // TODO(darin): HTML escape this |
[email protected] | a0200c5 | 2011-10-13 14:19:27 | [diff] [blame] | 44 | markup.append(net::EscapeForHTML(UTF16ToUTF8(title))); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 45 | markup.append("</a>"); |
| 46 | return markup; |
| 47 | } |
| 48 | |
[email protected] | b9a0b1b3 | 2009-03-30 23:09:37 | [diff] [blame] | 49 | // Static |
| 50 | std::string WebClipboardImpl::URLToImageMarkup(const WebURL& url, |
| 51 | const WebString& title) { |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 52 | std::string markup("<img src=\""); |
| 53 | markup.append(url.spec()); |
| 54 | markup.append("\""); |
| 55 | if (!title.isEmpty()) { |
| 56 | markup.append(" alt=\""); |
[email protected] | a0200c5 | 2011-10-13 14:19:27 | [diff] [blame] | 57 | markup.append(net::EscapeForHTML(UTF16ToUTF8(title))); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 58 | markup.append("\""); |
| 59 | } |
| 60 | markup.append("/>"); |
| 61 | return markup; |
| 62 | } |
| 63 | |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 64 | WebClipboardImpl::WebClipboardImpl(ClipboardClient* client) |
| 65 | : client_(client) { |
| 66 | } |
| 67 | |
[email protected] | 04bf3ad | 2010-08-27 21:23:48 | [diff] [blame] | 68 | WebClipboardImpl::~WebClipboardImpl() { |
| 69 | } |
| 70 | |
[email protected] | 36780a1 | 2011-11-04 18:16:44 | [diff] [blame] | 71 | uint64 WebClipboardImpl::getSequenceNumber() { |
[email protected] | 9cf12c3 | 2011-11-10 19:28:07 | [diff] [blame] | 72 | return sequenceNumber(BufferStandard); |
| 73 | } |
| 74 | |
| 75 | uint64 WebClipboardImpl::sequenceNumber(Buffer buffer) { |
| 76 | ui::Clipboard::Buffer buffer_type; |
| 77 | if (!ConvertBufferType(buffer, &buffer_type)) |
| 78 | return 0; |
| 79 | |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 80 | return client_->GetSequenceNumber(buffer_type); |
[email protected] | 36780a1 | 2011-11-04 18:16:44 | [diff] [blame] | 81 | } |
| 82 | |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 83 | bool WebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { |
[email protected] | 757d4e54 | 2012-01-20 22:23:42 | [diff] [blame] | 84 | ui::Clipboard::Buffer buffer_type = ui::Clipboard::BUFFER_STANDARD; |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 85 | |
[email protected] | 606876c | 2011-03-24 17:13:38 | [diff] [blame] | 86 | if (!ConvertBufferType(buffer, &buffer_type)) |
| 87 | return false; |
| 88 | |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 89 | switch (format) { |
[email protected] | 606876c | 2011-03-24 17:13:38 | [diff] [blame] | 90 | case FormatPlainText: |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 91 | return client_->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), |
[email protected] | 606876c | 2011-03-24 17:13:38 | [diff] [blame] | 92 | buffer_type) || |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 93 | client_->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(), |
[email protected] | 606876c | 2011-03-24 17:13:38 | [diff] [blame] | 94 | buffer_type); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 95 | case FormatHTML: |
[email protected] | ff53be6 | 2011-12-07 23:28:29 | [diff] [blame] | 96 | return client_->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(), |
| 97 | buffer_type); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 98 | case FormatSmartPaste: |
[email protected] | ff53be6 | 2011-12-07 23:28:29 | [diff] [blame] | 99 | return client_->IsFormatAvailable( |
| 100 | ui::Clipboard::GetWebKitSmartPasteFormatType(), buffer_type); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 101 | case FormatBookmark: |
| 102 | #if defined(OS_WIN) || defined(OS_MACOSX) |
[email protected] | ff53be6 | 2011-12-07 23:28:29 | [diff] [blame] | 103 | return client_->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(), |
| 104 | buffer_type); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 105 | #endif |
| 106 | default: |
| 107 | NOTREACHED(); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 108 | } |
| 109 | |
[email protected] | ff53be6 | 2011-12-07 23:28:29 | [diff] [blame] | 110 | return false; |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 111 | } |
| 112 | |
[email protected] | 36780a1 | 2011-11-04 18:16:44 | [diff] [blame] | 113 | WebVector<WebString> WebClipboardImpl::readAvailableTypes( |
| 114 | Buffer buffer, bool* contains_filenames) { |
| 115 | ui::Clipboard::Buffer buffer_type; |
[email protected] | 8275835 | 2013-03-29 19:21:31 | [diff] [blame^] | 116 | std::vector<base::string16> types; |
[email protected] | 36780a1 | 2011-11-04 18:16:44 | [diff] [blame] | 117 | if (ConvertBufferType(buffer, &buffer_type)) { |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 118 | client_->ReadAvailableTypes(buffer_type, &types, contains_filenames); |
[email protected] | 36780a1 | 2011-11-04 18:16:44 | [diff] [blame] | 119 | } |
| 120 | return types; |
| 121 | } |
| 122 | |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 123 | WebString WebClipboardImpl::readPlainText(Buffer buffer) { |
[email protected] | 2dfeaf9 | 2011-01-10 21:08:21 | [diff] [blame] | 124 | ui::Clipboard::Buffer buffer_type; |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 125 | if (!ConvertBufferType(buffer, &buffer_type)) |
| 126 | return WebString(); |
| 127 | |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 128 | if (client_->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(), |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 129 | buffer_type)) { |
[email protected] | 8275835 | 2013-03-29 19:21:31 | [diff] [blame^] | 130 | base::string16 text; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 131 | client_->ReadText(buffer_type, &text); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 132 | if (!text.empty()) |
[email protected] | 3a2a5d2 | 2009-03-04 03:36:36 | [diff] [blame] | 133 | return text; |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 134 | } |
| 135 | |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 136 | if (client_->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 137 | buffer_type)) { |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 138 | std::string text; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 139 | client_->ReadAsciiText(buffer_type, &text); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 140 | if (!text.empty()) |
[email protected] | 3a2a5d2 | 2009-03-04 03:36:36 | [diff] [blame] | 141 | return ASCIIToUTF16(text); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | return WebString(); |
| 145 | } |
| 146 | |
[email protected] | a96790b | 2011-10-06 22:24:10 | [diff] [blame] | 147 | WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url, |
| 148 | unsigned* fragment_start, |
| 149 | unsigned* fragment_end) { |
| 150 | ui::Clipboard::Buffer buffer_type; |
| 151 | if (!ConvertBufferType(buffer, &buffer_type)) |
| 152 | return WebString(); |
| 153 | |
[email protected] | 8275835 | 2013-03-29 19:21:31 | [diff] [blame^] | 154 | base::string16 html_stdstr; |
[email protected] | a96790b | 2011-10-06 22:24:10 | [diff] [blame] | 155 | GURL gurl; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 156 | client_->ReadHTML(buffer_type, &html_stdstr, &gurl, |
[email protected] | a96790b | 2011-10-06 22:24:10 | [diff] [blame] | 157 | static_cast<uint32*>(fragment_start), |
| 158 | static_cast<uint32*>(fragment_end)); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 159 | *source_url = gurl; |
[email protected] | 3a2a5d2 | 2009-03-04 03:36:36 | [diff] [blame] | 160 | return html_stdstr; |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 161 | } |
| 162 | |
[email protected] | 3d4a691 | 2011-03-15 20:56:19 | [diff] [blame] | 163 | WebData WebClipboardImpl::readImage(Buffer buffer) { |
| 164 | ui::Clipboard::Buffer buffer_type; |
| 165 | if (!ConvertBufferType(buffer, &buffer_type)) |
| 166 | return WebData(); |
| 167 | |
| 168 | std::string png_data; |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 169 | client_->ReadImage(buffer_type, &png_data); |
[email protected] | 3d4a691 | 2011-03-15 20:56:19 | [diff] [blame] | 170 | return WebData(png_data); |
| 171 | } |
| 172 | |
[email protected] | c6562f4 | 2011-12-04 06:19:37 | [diff] [blame] | 173 | WebString WebClipboardImpl::readCustomData(Buffer buffer, |
| 174 | const WebString& type) { |
| 175 | ui::Clipboard::Buffer buffer_type; |
| 176 | if (!ConvertBufferType(buffer, &buffer_type)) |
| 177 | return WebString(); |
| 178 | |
[email protected] | 8275835 | 2013-03-29 19:21:31 | [diff] [blame^] | 179 | base::string16 data; |
[email protected] | c6562f4 | 2011-12-04 06:19:37 | [diff] [blame] | 180 | client_->ReadCustomData(buffer_type, type, &data); |
| 181 | return data; |
| 182 | } |
| 183 | |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 184 | void WebClipboardImpl::writeHTML( |
| 185 | const WebString& html_text, const WebURL& source_url, |
| 186 | const WebString& plain_text, bool write_smart_paste) { |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 187 | ScopedClipboardWriterGlue scw(client_); |
[email protected] | 3a2a5d2 | 2009-03-04 03:36:36 | [diff] [blame] | 188 | scw.WriteHTML(html_text, source_url.spec()); |
| 189 | scw.WriteText(plain_text); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 190 | |
| 191 | if (write_smart_paste) |
| 192 | scw.WriteWebSmartPaste(); |
| 193 | } |
| 194 | |
[email protected] | 8c95a75 | 2009-09-25 10:54:22 | [diff] [blame] | 195 | void WebClipboardImpl::writePlainText(const WebString& plain_text) { |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 196 | ScopedClipboardWriterGlue scw(client_); |
[email protected] | 8c95a75 | 2009-09-25 10:54:22 | [diff] [blame] | 197 | scw.WriteText(plain_text); |
| 198 | } |
| 199 | |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 200 | void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) { |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 201 | ScopedClipboardWriterGlue scw(client_); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 202 | |
[email protected] | 3a2a5d2 | 2009-03-04 03:36:36 | [diff] [blame] | 203 | scw.WriteBookmark(title, url.spec()); |
| 204 | scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), ""); |
[email protected] | 39a749c | 2011-01-28 02:40:46 | [diff] [blame] | 205 | scw.WriteText(UTF8ToUTF16(std::string(url.spec()))); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | void WebClipboardImpl::writeImage( |
| 209 | const WebImage& image, const WebURL& url, const WebString& title) { |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 210 | ScopedClipboardWriterGlue scw(client_); |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 211 | |
[email protected] | 8973f52 | 2009-07-03 05:58:45 | [diff] [blame] | 212 | if (!image.isNull()) { |
[email protected] | 8973f52 | 2009-07-03 05:58:45 | [diff] [blame] | 213 | const SkBitmap& bitmap = image.getSkBitmap(); |
[email protected] | 8973f52 | 2009-07-03 05:58:45 | [diff] [blame] | 214 | SkAutoLockPixels locked(bitmap); |
| 215 | scw.WriteBitmapFromPixels(bitmap.getPixels(), image.size()); |
| 216 | } |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 217 | |
[email protected] | 59d9aacf | 2009-11-30 22:59:25 | [diff] [blame] | 218 | if (!url.isEmpty()) { |
| 219 | scw.WriteBookmark(title, url.spec()); |
[email protected] | 0930323 | 2011-06-09 19:28:31 | [diff] [blame] | 220 | #if !defined(OS_MACOSX) |
| 221 | // When writing the image, we also write the image markup so that pasting |
| 222 | // into rich text editors, such as Gmail, reveals the image. We also don't |
| 223 | // want to call writeText(), since some applications (WordPad) don't pick |
| 224 | // the image if there is also a text format on the clipboard. |
| 225 | // We also don't want to write HTML on a Mac, since Mail.app prefers to use |
| 226 | // the image markup over attaching the actual image. See |
| 227 | // http://crbug.com/33016 for details. |
[email protected] | 59d9aacf | 2009-11-30 22:59:25 | [diff] [blame] | 228 | scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), ""); |
[email protected] | 0930323 | 2011-06-09 19:28:31 | [diff] [blame] | 229 | #endif |
[email protected] | 59d9aacf | 2009-11-30 22:59:25 | [diff] [blame] | 230 | } |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 231 | } |
| 232 | |
[email protected] | 3f031829 | 2011-11-18 21:49:00 | [diff] [blame] | 233 | void WebClipboardImpl::writeDataObject(const WebDragData& data) { |
[email protected] | 0de5d860 | 2011-11-22 03:48:52 | [diff] [blame] | 234 | ScopedClipboardWriterGlue scw(client_); |
[email protected] | 3f031829 | 2011-11-18 21:49:00 | [diff] [blame] | 235 | |
[email protected] | 2ffbb48 | 2011-12-05 23:41:17 | [diff] [blame] | 236 | WebDropData data_object(data); |
[email protected] | 3f031829 | 2011-11-18 21:49:00 | [diff] [blame] | 237 | // TODO(dcheng): Properly support text/uri-list here. |
[email protected] | da41ae9 | 2012-06-16 01:28:17 | [diff] [blame] | 238 | if (!data_object.text.is_null()) |
| 239 | scw.WriteText(data_object.text.string()); |
| 240 | if (!data_object.html.is_null()) |
| 241 | scw.WriteHTML(data_object.html.string(), ""); |
[email protected] | fbf7541 | 2012-01-07 01:26:52 | [diff] [blame] | 242 | // If there is no custom data, avoid calling WritePickledData. This ensures |
| 243 | // that ScopedClipboardWriterGlue's dtor remains a no-op if the page didn't |
| 244 | // modify the DataTransfer object, which is important to avoid stomping on |
| 245 | // any clipboard contents written by extension functions such as |
[email protected] | a19258af | 2012-09-21 06:36:33 | [diff] [blame] | 246 | // chrome.bookmarkManagerPrivate.copy. |
[email protected] | fbf7541 | 2012-01-07 01:26:52 | [diff] [blame] | 247 | if (!data_object.custom_data.empty()) { |
| 248 | Pickle pickle; |
| 249 | ui::WriteCustomDataToPickle(data_object.custom_data, &pickle); |
| 250 | scw.WritePickledData(pickle, ui::Clipboard::GetWebCustomDataFormatType()); |
| 251 | } |
[email protected] | 3f031829 | 2011-11-18 21:49:00 | [diff] [blame] | 252 | } |
| 253 | |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 254 | bool WebClipboardImpl::ConvertBufferType(Buffer buffer, |
[email protected] | 2dfeaf9 | 2011-01-10 21:08:21 | [diff] [blame] | 255 | ui::Clipboard::Buffer* result) { |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 256 | switch (buffer) { |
| 257 | case BufferStandard: |
[email protected] | 2dfeaf9 | 2011-01-10 21:08:21 | [diff] [blame] | 258 | *result = ui::Clipboard::BUFFER_STANDARD; |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 259 | break; |
| 260 | case BufferSelection: |
[email protected] | 264b319 | 2012-08-10 21:56:46 | [diff] [blame] | 261 | #if defined(USE_X11) |
| 262 | #if defined(OS_CHROMEOS) |
| 263 | // Chrome OS only supports the standard clipboard, |
| 264 | // but not the X selection clipboad. |
| 265 | return false; |
| 266 | #else |
[email protected] | 2dfeaf9 | 2011-01-10 21:08:21 | [diff] [blame] | 267 | *result = ui::Clipboard::BUFFER_SELECTION; |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 268 | break; |
| 269 | #endif |
[email protected] | 264b319 | 2012-08-10 21:56:46 | [diff] [blame] | 270 | #endif |
[email protected] | 65a6150d | 2009-09-08 22:16:05 | [diff] [blame] | 271 | default: |
| 272 | NOTREACHED(); |
| 273 | return false; |
| 274 | } |
| 275 | return true; |
| 276 | } |
| 277 | |
[email protected] | c62ce3e | 2009-02-26 00:15:20 | [diff] [blame] | 278 | } // namespace webkit_glue |