| OLD | NEW |
| 1 // Copyright (c) 2011 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_PRERENDER_PRERENDER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | |
| 9 #include "url/gurl.h" | 8 #include "url/gurl.h" |
| 10 | 9 |
| 11 namespace prerender { | 10 namespace prerender { |
| 12 | 11 |
| 13 // Extracts a urlencoded URL stored in a url= query parameter from a URL | 12 // Extracts a urlencoded URL stored in a url= query parameter from a URL |
| 14 // supplied, if available, and stores it in alias_url. Returns whether or not | 13 // supplied, if available, and stores it in alias_url. Returns whether or not |
| 15 // the operation succeeded (i.e. a valid URL was found). | 14 // the operation succeeded (i.e. a valid URL was found). |
| 16 bool MaybeGetQueryStringBasedAliasURL(const GURL& url, GURL* alias_url); | 15 bool MaybeGetQueryStringBasedAliasURL(const GURL& url, GURL* alias_url); |
| 17 | 16 |
| 18 // Indicates whether the URL provided has a Google domain | 17 // Indicates whether the URL provided has a Google domain |
| 19 bool IsGoogleDomain(const GURL& url); | 18 bool IsGoogleDomain(const GURL& url); |
| 20 | 19 |
| 21 // Indicates whether the URL provided could be a Google search result page. | 20 // Indicates whether the URL provided could be a Google search result page. |
| 22 bool IsGoogleSearchResultURL(const GURL& url); | 21 bool IsGoogleSearchResultURL(const GURL& url); |
| 23 | 22 |
| 24 // Report a URL was canceled due to trying to handle an external URL. | 23 // Report a URL was canceled due to trying to handle an external URL. |
| 25 void ReportPrerenderExternalURL(); | 24 void ReportPrerenderExternalURL(); |
| 26 | 25 |
| 27 // Report a URL was canceled due to unsupported prerender scheme. | 26 // Report a URL was canceled due to unsupported prerender scheme. |
| 28 void ReportUnsupportedPrerenderScheme(const GURL& url); | 27 void ReportUnsupportedPrerenderScheme(const GURL& url); |
| 29 | 28 |
| 30 } // namespace prerender | 29 } // namespace prerender |
| 31 | 30 |
| 32 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ | 31 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ |
| OLD | NEW |