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

Unified Diff: chrome/browser/net/browser_url_util.cc

Issue 260003: Move the clipboard stuff out of base and into app/clipboard. I renamed... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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 | « chrome/browser/net/browser_url_util.h ('k') | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/browser_url_util.cc
===================================================================
--- chrome/browser/net/browser_url_util.cc (revision 0)
+++ chrome/browser/net/browser_url_util.cc (revision 0)
@@ -0,0 +1,29 @@
+// Copyright (c) 2009 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 "chrome/browser/net/browser_url_util.h"
+
+#include "app/clipboard/scoped_clipboard_writer.h"
+#include "base/string_util.h"
+#include "googleurl/src/gurl.h"
+#include "net/base/net_util.h"
+
+namespace chrome_browser_net {
+
+void WriteURLToClipboard(const GURL& url,
+ const std::wstring& languages,
+ Clipboard *clipboard) {
+ if (url.is_empty() || !url.is_valid() || !clipboard)
+ return;
+
+ // 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,
+ UnescapeRule::NONE, NULL, NULL));
+
+ ScopedClipboardWriter scw(clipboard);
+ scw.WriteURL(text);
+}
+
+} // namespace chrome_browser_net
Property changes on: chrome\browser\net\browser_url_util.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/net/browser_url_util.h ('k') | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698