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 "content/public/common/resource_type.h" | 9 #include "content/public/common/resource_type.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 class HttpResponseHeaders; | 13 class HttpResponseHeaders; |
14 class URLRequest; | 14 class URLRequest; |
15 } | 15 } |
16 | 16 |
17 namespace prerender { | 17 namespace prerender { |
18 | 18 |
19 extern const char kChromeNavigateExtraDataKey[]; | |
20 | |
21 // ID indicating that no experiment is active. | 19 // ID indicating that no experiment is active. |
22 const uint8 kNoExperiment = 0; | 20 const uint8 kNoExperiment = 0; |
23 | 21 |
24 // Extracts a urlencoded URL stored in a url= query parameter from a URL | 22 // Extracts a urlencoded URL stored in a url= query parameter from a URL |
25 // supplied, if available, and stores it in alias_url. Returns whether or not | 23 // supplied, if available, and stores it in alias_url. Returns whether or not |
26 // the operation succeeded (i.e. a valid URL was found). | 24 // the operation succeeded (i.e. a valid URL was found). |
27 bool MaybeGetQueryStringBasedAliasURL(const GURL& url, GURL* alias_url); | 25 bool MaybeGetQueryStringBasedAliasURL(const GURL& url, GURL* alias_url); |
28 | 26 |
29 // Extracts an experiment stored in the query parameter | 27 // Extracts an experiment stored in the query parameter |
30 // lpe= from the URL supplied, and returns it. | 28 // lpe= from the URL supplied, and returns it. |
(...skipping 30 matching lines...) Expand all Loading... |
61 | 59 |
62 // Report a URL was canceled due to trying to handle an external URL. | 60 // Report a URL was canceled due to trying to handle an external URL. |
63 void ReportPrerenderExternalURL(); | 61 void ReportPrerenderExternalURL(); |
64 | 62 |
65 // Report a URL was canceled due to unsupported prerender scheme. | 63 // Report a URL was canceled due to unsupported prerender scheme. |
66 void ReportUnsupportedPrerenderScheme(const GURL& url); | 64 void ReportUnsupportedPrerenderScheme(const GURL& url); |
67 | 65 |
68 } // namespace prerender | 66 } // namespace prerender |
69 | 67 |
70 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ | 68 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_UTIL_H_ |
OLD | NEW |