OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_HISTORY_CORE_BROWSER_URL_UTILS_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_URL_UTILS_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_UTILS_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 class GURL; | 10 class GURL; |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Treats |path1| and |path2| as lists of path components (e.g., ["a", "bb"] | 34 // Treats |path1| and |path2| as lists of path components (e.g., ["a", "bb"] |
35 // for "/a/bb"). Returns whether |path1|'s list is a prefix of |path2|'s list. | 35 // for "/a/bb"). Returns whether |path1|'s list is a prefix of |path2|'s list. |
36 // This is used to define "URL prefix". Note that "test" does not count as a | 36 // This is used to define "URL prefix". Note that "test" does not count as a |
37 // prefix of "testing", even though "test" is a (string) prefix of "testing". | 37 // prefix of "testing", even though "test" is a (string) prefix of "testing". |
38 bool IsPathPrefix(const std::string& p1, const std::string& p2); | 38 bool IsPathPrefix(const std::string& p1, const std::string& p2); |
39 | 39 |
40 // Converts |url| from HTTP to HTTPS, and vice versa, then returns the result. | 40 // Converts |url| from HTTP to HTTPS, and vice versa, then returns the result. |
41 // If |url| is neither HTTP nor HTTPS, returns an empty URL. | 41 // If |url| is neither HTTP nor HTTPS, returns an empty URL. |
42 GURL ToggleHTTPAndHTTPS(const GURL& url); | 42 GURL ToggleHTTPAndHTTPS(const GURL& url); |
43 | 43 |
| 44 // Returns the host of the given URL, canonicalized as it would be for |
| 45 // HistoryService::TopHosts(). |
| 46 std::string HostForTopHosts(const GURL& url); |
| 47 |
44 } // namespace history | 48 } // namespace history |
45 | 49 |
46 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_UTILS_H_ | 50 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_UTILS_H_ |
OLD | NEW |