diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 20:20:32 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 20:20:32 +0000 |
commit | 13ca34eb7b4cacadc4c6568adfbde0b81d1d3286 (patch) | |
tree | 81c04b9f3c360679ca0a01c48f0995919a8ffd14 /chrome | |
parent | 4ca10ed5f913a33edd8186f3b02009a8609f851b (diff) | |
download | chromium_src-13ca34eb7b4cacadc4c6568adfbde0b81d1d3286.zip chromium_src-13ca34eb7b4cacadc4c6568adfbde0b81d1d3286.tar.gz chromium_src-13ca34eb7b4cacadc4c6568adfbde0b81d1d3286.tar.bz2 |
Mailto links should not include mailto: when copying to the clipboard.
BUG=24430
TEST=Right click a mailto:foo@bar.com link on a page, select Copy email
address. Make sure the clipboard contains foo@bar.com and no mailto:
prefix.
Review URL: http://codereview.chromium.org/342031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/net/browser_url_util.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/browser/net/browser_url_util.cc b/chrome/browser/net/browser_url_util.cc index 7688051..940d3b6 100644 --- a/chrome/browser/net/browser_url_util.cc +++ b/chrome/browser/net/browser_url_util.cc @@ -6,6 +6,7 @@ #include "app/clipboard/scoped_clipboard_writer.h" #include "base/string_util.h" +#include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" @@ -19,7 +20,9 @@ void WriteURLToClipboard(const GURL& url, // Unescaping path and query is not a good idea because other applications // may not encode non-ASCII characters in UTF-8. See crbug.com/2820. - string16 text = WideToUTF16(net::FormatUrl(url, languages, false, + string16 text = url.SchemeIs(chrome::kMailToScheme) ? + ASCIIToUTF16(url.path()) : + WideToUTF16(net::FormatUrl(url, languages, false, UnescapeRule::NONE, NULL, NULL)); ScopedClipboardWriter scw(clipboard); |