OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 IOS_WEB_PUBLIC_REFERRER_H_ | 5 #ifndef IOS_WEB_PUBLIC_REFERRER_H_ |
6 #define IOS_WEB_PUBLIC_REFERRER_H_ | 6 #define IOS_WEB_PUBLIC_REFERRER_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 namespace web { | 11 namespace web { |
12 | 12 |
13 enum ReferrerPolicy { | 13 enum ReferrerPolicy { |
14 ReferrerPolicyAlways, | 14 ReferrerPolicyAlways, |
15 ReferrerPolicyDefault, | 15 ReferrerPolicyDefault, |
16 ReferrerPolicyNoReferrerWhenDowngrade, | 16 ReferrerPolicyNoReferrerWhenDowngrade, |
17 ReferrerPolicyNever, | 17 ReferrerPolicyNever, |
18 ReferrerPolicyOrigin, | 18 ReferrerPolicyOrigin, |
19 ReferrerPolicyOriginWhenCrossOrigin, | 19 ReferrerPolicyOriginWhenCrossOrigin, |
20 ReferrerPolicyLast = ReferrerPolicyOriginWhenCrossOrigin | 20 ReferrerPolicySameOrigin, |
| 21 ReferrerPolicyStrictOrigin, |
| 22 ReferrerPolicyStrictOriginWhenCrossOrigin, |
| 23 ReferrerPolicyLast = ReferrerPolicyStrictOriginWhenCrossOrigin |
21 }; | 24 }; |
22 | 25 |
23 // This struct holds a referrer URL, as well as the referrer policy to be | 26 // This struct holds a referrer URL, as well as the referrer policy to be |
24 // applied to this URL. When passing around referrers that will eventually end | 27 // applied to this URL. When passing around referrers that will eventually end |
25 // up being used for URL requests, always use this struct. | 28 // up being used for URL requests, always use this struct. |
26 struct Referrer { | 29 struct Referrer { |
27 Referrer(const GURL& url, ReferrerPolicy policy) : url(url), policy(policy) {} | 30 Referrer(const GURL& url, ReferrerPolicy policy) : url(url), policy(policy) {} |
28 Referrer() : policy(ReferrerPolicyDefault) {} | 31 Referrer() : policy(ReferrerPolicyDefault) {} |
29 | 32 |
30 GURL url; | 33 GURL url; |
31 ReferrerPolicy policy; | 34 ReferrerPolicy policy; |
32 }; | 35 }; |
33 | 36 |
34 } // namespace web | 37 } // namespace web |
35 | 38 |
36 #endif // IOS_WEB_PUBLIC_REFERRER_H_ | 39 #endif // IOS_WEB_PUBLIC_REFERRER_H_ |
OLD | NEW |