| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "webkit/glue/webclipboard_impl.h" | 5 #include "webkit/glue/webclipboard_impl.h" |
| 6 | 6 |
| 7 #include "base/clipboard.h" | 7 #include "base/clipboard.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 scw.WriteBookmark(title, url.spec()); | 113 scw.WriteBookmark(title, url.spec()); |
| 114 scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), ""); | 114 scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), ""); |
| 115 scw.WriteText(UTF8ToUTF16(url.spec())); | 115 scw.WriteText(UTF8ToUTF16(url.spec())); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void WebClipboardImpl::writeImage( | 118 void WebClipboardImpl::writeImage( |
| 119 const WebImage& image, const WebURL& url, const WebString& title) { | 119 const WebImage& image, const WebURL& url, const WebString& title) { |
| 120 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); | 120 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); |
| 121 | 121 |
| 122 #if defined(OS_WIN) | 122 #if defined(OS_WIN) || defined(OS_LINUX) |
| 123 if (!image.isNull()) | 123 if (!image.isNull()) |
| 124 scw.WriteBitmapFromPixels(image.pixels(), image.size()); | 124 scw.WriteBitmapFromPixels(image.pixels(), image.size()); |
| 125 #endif | 125 #endif |
| 126 | 126 |
| 127 if (!url.isEmpty()) { | 127 if (!url.isEmpty()) { |
| 128 scw.WriteBookmark(title, url.spec()); | 128 scw.WriteBookmark(title, url.spec()); |
| 129 scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), ""); | 129 scw.WriteHTML(UTF8ToUTF16(URLToImageMarkup(url, title)), ""); |
| 130 scw.WriteText(UTF8ToUTF16(url.spec())); | 130 scw.WriteText(UTF8ToUTF16(url.spec())); |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace webkit_glue | 134 } // namespace webkit_glue |
| OLD | NEW |