Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: content/public/common/referrer.h

Issue 2682313002: Introduce NavigationSimulator to use in unit tests (Closed)
Patch Set: Addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/public/common/referrer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_COMMON_REFERRER_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_REFERRER_H_
6 #define CONTENT_PUBLIC_COMMON_REFERRER_H_ 6 #define CONTENT_PUBLIC_COMMON_REFERRER_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "net/url_request/url_request.h"
10 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" 11 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
11 #include "url/gurl.h" 12 #include "url/gurl.h"
12 13
13 namespace net {
14 class URLRequest;
15 }
16
17 namespace content { 14 namespace content {
18 15
19 // This struct holds a referrer URL, as well as the referrer policy to be 16 // This struct holds a referrer URL, as well as the referrer policy to be
20 // applied to this URL. When passing around referrers that will eventually end 17 // applied to this URL. When passing around referrers that will eventually end
21 // up being used for URL requests, always use this struct. 18 // up being used for URL requests, always use this struct.
22 struct CONTENT_EXPORT Referrer { 19 struct CONTENT_EXPORT Referrer {
23 Referrer(const GURL& url, blink::WebReferrerPolicy policy) 20 Referrer(const GURL& url, blink::WebReferrerPolicy policy)
24 : url(url), policy(policy) {} 21 : url(url), policy(policy) {}
25 Referrer() : policy(blink::WebReferrerPolicyDefault) {} 22 Referrer() : policy(blink::WebReferrerPolicyDefault) {}
26 23
27 GURL url; 24 GURL url;
28 blink::WebReferrerPolicy policy; 25 blink::WebReferrerPolicy policy;
29 26
30 static Referrer SanitizeForRequest(const GURL& request, 27 static Referrer SanitizeForRequest(const GURL& request,
31 const Referrer& referrer); 28 const Referrer& referrer);
32 29
33 static void SetReferrerForRequest(net::URLRequest* request, 30 static void SetReferrerForRequest(net::URLRequest* request,
34 const Referrer& referrer); 31 const Referrer& referrer);
32
33 static net::URLRequest::ReferrerPolicy ReferrerPolicyForUrlRequest(
34 const Referrer& referrer);
35 }; 35 };
36 36
37 } // namespace content 37 } // namespace content
38 38
39 #endif // CONTENT_PUBLIC_COMMON_REFERRER_H_ 39 #endif // CONTENT_PUBLIC_COMMON_REFERRER_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/public/common/referrer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698