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

Unified Diff: webkit/renderer/clipboard_utils.cc

Issue 17420005: Move the following clipboard files from webkit\glue to webkit\renderer. These files now live in the… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 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 | « webkit/renderer/clipboard_utils.h ('k') | webkit/support/mock_webclipboard_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/renderer/clipboard_utils.cc
===================================================================
--- webkit/renderer/clipboard_utils.cc (revision 0)
+++ webkit/renderer/clipboard_utils.cc (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "webkit/renderer/clipboard_utils.h"
+
+#include "base/strings/utf_string_conversions.h"
+#include "net/base/escape.h"
+
+namespace webkit_clipboard {
+
+// Static
+std::string URLToMarkup(const WebURL& url, const WebString& title) {
+ std::string markup("<a href=\"");
+ markup.append(url.spec());
+ markup.append("\">");
+ // TODO(darin): HTML escape this
+ markup.append(net::EscapeForHTML(UTF16ToUTF8(title)));
+ markup.append("</a>");
+ return markup;
+}
+
+std::string URLToImageMarkup(const WebURL& url, const WebString& title) {
+ std::string markup("<img src=\"");
+ markup.append(url.spec());
+ markup.append("\"");
+ if (!title.isEmpty()) {
+ markup.append(" alt=\"");
+ markup.append(net::EscapeForHTML(UTF16ToUTF8(title)));
+ markup.append("\"");
+ }
+ markup.append("/>");
+ return markup;
+}
+
+} // webkit_clipboard
+
Property changes on: webkit\renderer\clipboard_utils.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « webkit/renderer/clipboard_utils.h ('k') | webkit/support/mock_webclipboard_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698