OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_ | 5 #ifndef CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_ |
6 #define CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_ | 6 #define CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 class GURL; | 11 class GURL; |
(...skipping 16 matching lines...) Expand all Loading... |
28 // Examples: | 28 // Examples: |
29 // | 29 // |
30 // AppendQueryParameter(GURL("http://example.com"), "name", "value").spec() | 30 // AppendQueryParameter(GURL("http://example.com"), "name", "value").spec() |
31 // => "http://example.com?name=value" | 31 // => "http://example.com?name=value" |
32 // AppendQueryParameter(GURL("http://example.com?x=y"), "name", "value").spec() | 32 // AppendQueryParameter(GURL("http://example.com?x=y"), "name", "value").spec() |
33 // => "http://example.com?x=y&name=value" | 33 // => "http://example.com?x=y&name=value" |
34 GURL AppendQueryParameter(const GURL& url, | 34 GURL AppendQueryParameter(const GURL& url, |
35 const std::string& name, | 35 const std::string& name, |
36 const std::string& value); | 36 const std::string& value); |
37 | 37 |
38 // Looks for |search_key| in the query portion of |url|. Returns true if the | |
39 // key is found and sets |out_value| to the unescaped value for the key. | |
40 // Returns false if the key is not found. | |
41 bool GetValueForKeyInQuery(const GURL& url, | |
42 const std::string& search_key, | |
43 std::string* out_value); | |
44 | |
45 } // namespace chrome_browser_net | 38 } // namespace chrome_browser_net |
46 | 39 |
47 #endif // CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_ | 40 #endif // CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_ |
OLD | NEW |