| // Copyright 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 "content/renderer/clipboard_utils.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "net/base/escape.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
| #include "third_party/WebKit/public/platform/WebURL.h" |
| std::string URLToMarkup(const WebKit::WebURL& url, |
| const WebKit::WebString& title) { |
| std::string markup("<a href=\""); |
| markup.append(url.spec()); |
| // TODO(darin): HTML escape this |
| markup.append(net::EscapeForHTML(UTF16ToUTF8(title))); |
| std::string URLToImageMarkup(const WebKit::WebURL& url, |
| const WebKit::WebString& title) { |
| std::string markup("<img src=\""); |
| markup.append(net::EscapeForHTML(url.spec())); |
| markup.append(" alt=\""); |
| markup.append(net::EscapeForHTML(UTF16ToUTF8(title))); |