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

Side by Side Diff: chrome/common/net/url_util.cc

Issue 10384086: Moved url_utils from chrome/browser/net to chrome/common/net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/url_util.h ('k') | chrome/common/net/url_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/browser_url_util.h" 5 #include "chrome/common/net/url_util.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 #include "googleurl/src/url_parse.h" 11 #include "googleurl/src/url_parse.h"
12 #include "net/base/escape.h" 12 #include "net/base/escape.h"
13 #include "net/base/net_util.h" 13 #include "net/base/net_util.h"
14 #include "ui/base/clipboard/scoped_clipboard_writer.h" 14 #include "ui/base/clipboard/scoped_clipboard_writer.h"
15 15
16 namespace chrome_browser_net { 16 namespace chrome_common_net {
17 17
18 void WriteURLToClipboard(const GURL& url, 18 void WriteURLToClipboard(const GURL& url,
19 const std::string& languages, 19 const std::string& languages,
20 ui::Clipboard *clipboard) { 20 ui::Clipboard *clipboard) {
21 if (url.is_empty() || !url.is_valid() || !clipboard) 21 if (url.is_empty() || !url.is_valid() || !clipboard)
22 return; 22 return;
23 23
24 // Unescaping path and query is not a good idea because other applications 24 // Unescaping path and query is not a good idea because other applications
25 // may not encode non-ASCII characters in UTF-8. See crbug.com/2820. 25 // may not encode non-ASCII characters in UTF-8. See crbug.com/2820.
26 string16 text = url.SchemeIs(chrome::kMailToScheme) ? 26 string16 text = url.SchemeIs(chrome::kMailToScheme) ?
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if (!output.empty()) 84 if (!output.empty())
85 output += "&"; 85 output += "&";
86 86
87 output += (param_name + "=" + param_value); 87 output += (param_name + "=" + param_value);
88 } 88 }
89 GURL::Replacements replacements; 89 GURL::Replacements replacements;
90 replacements.SetQueryStr(output); 90 replacements.SetQueryStr(output);
91 return url.ReplaceComponents(replacements); 91 return url.ReplaceComponents(replacements);
92 } 92 }
93 93
94 } // namespace chrome_browser_net 94 } // namespace chrome_common_net
OLDNEW
« no previous file with comments | « chrome/common/net/url_util.h ('k') | chrome/common/net/url_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698