| 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" | 8 #include "base/basictypes.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 | 10 |
| 11 namespace prerender { | 11 namespace prerender { |
| 12 | 12 |
| 13 // ID indicating that no experiment is active. | 13 // ID indicating that no experiment is active. |
| 14 const uint8 kNoExperiment = 0; | 14 const uint8 kNoExperiment = 0; |
| 15 | 15 |
| 16 // Extracts a urlencoded URL stored in a url= query parameter from a URL | 16 // Extracts a urlencoded URL stored in a url= query parameter from a URL |
| 17 // supplied, if available, and stores it in alias_url. Returns whether or not | 17 // supplied, if available, and stores it in alias_url. Returns whether or not |
| 18 // the operation succeeded (i.e. a valid URL was found). | 18 // the operation succeeded (i.e. a valid URL was found). |
| 19 bool MaybeGetQueryStringBasedAliasURL(const GURL& url, GURL* alias_url); | 19 bool MaybeGetQueryStringBasedAliasURL(const GURL& url, GURL* alias_url); |
| 20 | 20 |
| 21 // Extracts an experiment stored in the query parameter | 21 // Extracts an experiment stored in the query parameter |
| 22 // lpe= from the URL supplied, and returns it. | 22 // lpe= from the URL supplied, and returns it. |
| 23 // Returns kNoExperiment if no experiment ID is found, or if the ID | 23 // Returns kNoExperiment if no experiment ID is found, or if the ID |
| 24 // is not an integer in the range 1 to 9. | 24 // is not an integer in the range 1 to 9. |
| 25 uint8 GetQueryStringBasedExperiment(const GURL& url); | 25 uint8 GetQueryStringBasedExperiment(const GURL& url); |
| 26 | 26 |
| 27 // Indicates whether the URL provided could be a Google search result page. |
| 28 bool IsGoogleSearchResultURL(const GURL& url); |
| 29 |
| 27 } // namespace prerender | 30 } // namespace prerender |
| 28 | 31 |
| 29 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ | 32 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ |
| OLD | NEW |