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

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

Issue 211052: Implement ChromiumBridge::clipboardWritePlainText() (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « webkit/glue/webclipboard_impl.h ('k') | webkit/tools/test_shell/mock_webclipboard_impl.h » ('j') | 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 "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const WebString& html_text, const WebURL& source_url, 122 const WebString& html_text, const WebURL& source_url,
123 const WebString& plain_text, bool write_smart_paste) { 123 const WebString& plain_text, bool write_smart_paste) {
124 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); 124 ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
125 scw.WriteHTML(html_text, source_url.spec()); 125 scw.WriteHTML(html_text, source_url.spec());
126 scw.WriteText(plain_text); 126 scw.WriteText(plain_text);
127 127
128 if (write_smart_paste) 128 if (write_smart_paste)
129 scw.WriteWebSmartPaste(); 129 scw.WriteWebSmartPaste();
130 } 130 }
131 131
132 void WebClipboardImpl::writePlainText(const WebString& plain_text) {
133 ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
134 scw.WriteText(plain_text);
135 }
136
132 void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) { 137 void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) {
133 ScopedClipboardWriterGlue scw(ClipboardGetClipboard()); 138 ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
134 139
135 scw.WriteBookmark(title, url.spec()); 140 scw.WriteBookmark(title, url.spec());
136 scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), ""); 141 scw.WriteHTML(UTF8ToUTF16(URLToMarkup(url, title)), "");
137 scw.WriteText(UTF8ToUTF16(url.spec())); 142 scw.WriteText(UTF8ToUTF16(url.spec()));
138 } 143 }
139 144
140 void WebClipboardImpl::writeImage( 145 void WebClipboardImpl::writeImage(
141 const WebImage& image, const WebURL& url, const WebString& title) { 146 const WebImage& image, const WebURL& url, const WebString& title) {
(...skipping 28 matching lines...) Expand all
170 break; 175 break;
171 #endif 176 #endif
172 default: 177 default:
173 NOTREACHED(); 178 NOTREACHED();
174 return false; 179 return false;
175 } 180 }
176 return true; 181 return true;
177 } 182 }
178 183
179 } // namespace webkit_glue 184 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webclipboard_impl.h ('k') | webkit/tools/test_shell/mock_webclipboard_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698