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

Unified Diff: base/scoped_clipboard_writer.cc

Issue 194052: Clipboard:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fixes Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/scoped_clipboard_writer.h ('k') | chrome/browser/autocomplete/autocomplete_edit_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_clipboard_writer.cc
===================================================================
--- base/scoped_clipboard_writer.cc (revision 25821)
+++ base/scoped_clipboard_writer.cc (working copy)
@@ -67,18 +67,18 @@
objects_[Clipboard::CBF_BOOKMARK] = parameters;
}
-void ScopedClipboardWriter::WriteHyperlink(const string16& link_text,
+void ScopedClipboardWriter::WriteHyperlink(const std::string& anchor_text,
const std::string& url) {
- if (link_text.empty() || url.empty())
+ if (anchor_text.empty() || url.empty())
return;
- std::string utf8_markup = UTF16ToUTF8(link_text);
-
- Clipboard::ObjectMapParams parameters;
- parameters.push_back(Clipboard::ObjectMapParam(utf8_markup.begin(),
- utf8_markup.end()));
- parameters.push_back(Clipboard::ObjectMapParam(url.begin(), url.end()));
- objects_[Clipboard::CBF_LINK] = parameters;
+ // Construct the hyperlink.
+ std::string html("<a href=\"");
+ html.append(url);
+ html.append("\">");
+ html.append(anchor_text);
+ html.append("</a>");
+ WriteHTML(UTF8ToUTF16(html), std::string());
}
void ScopedClipboardWriter::WriteFile(const FilePath& file) {
« no previous file with comments | « base/scoped_clipboard_writer.h ('k') | chrome/browser/autocomplete/autocomplete_edit_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698