Index: chrome/browser/ui/webui/web_ui_util.h |
diff --git a/chrome/browser/ui/webui/web_ui_util.h b/chrome/browser/ui/webui/web_ui_util.h |
index 0a0eebf5dde6791b730a43f68e6ac3b44c6869d4..0a3ef11637fe12007181371e9eeb821605556ab5 100644 |
--- a/chrome/browser/ui/webui/web_ui_util.h |
+++ b/chrome/browser/ui/webui/web_ui_util.h |
@@ -25,6 +25,21 @@ std::string GetImageDataUrl(const SkBitmap& bitmap); |
// |resource_id|. |
std::string GetImageDataUrlFromResource(int resource_id); |
+// Returns true if |url| has a chrome: or about: scheme. |
+bool IsChromeURL(const GURL& url); |
+ |
+// GURL typically parses "scheme://host/path?query#ref" correctly, however: |
+// If chrome: omits scheme separator slashes, e.g. "chrome:host/path?query#ref", |
+// then GURL reports that the URL has no host and path "host/path?qry#ref". |
+// If about: has scheme separator slashes, e.g. "about://host/path?query#ref", |
+// then GURL reports that the URL has no host and path "//host/path?qry#ref". |
+// These functions parse common about and chrome URL formats as intended. |
+std::string GetChromeURLHost(const GURL& url); |
+std::string GetChromeURLPath(const GURL& url); |
abarth-chromium
2011/05/27 17:19:25
Should we fix GURL to get these cases right instea
msw
2011/05/31 13:34:29
I rewrote this as URLFixerUpper::FixupChromeURL. I
|
+ |
+// Returns true if |url|'s host matches |host|. |
+bool HostEquals(const GURL& url, const char* host); |
+ |
// Returns true if |url| has a chrome: or about: scheme and matching |host|. |
// The url may contain a path under the host. |
bool ChromeURLHostEquals(const GURL& url, const char* host); |