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

Side by Side Diff: webkit/glue/webclipboard_impl.cc

Issue 42592: Linux: write images to clipboard.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gtk_clipboard_dump/gtk_clipboard_dump.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « tools/gtk_clipboard_dump/gtk_clipboard_dump.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698