diff options
author | rohitrao <rohitrao@chromium.org> | 2014-10-22 15:10:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-22 22:10:30 +0000 |
commit | e3b4efb4ee6a8831bd2149ac4210435e6af76e96 (patch) | |
tree | 593d888035518d21b8bba10757f5e3d27c64f182 /ios/web | |
parent | f94a634d0be9d60b66a5ae9ca72cfa3f46d6754c (diff) | |
download | chromium_src-e3b4efb4ee6a8831bd2149ac4210435e6af76e96.zip chromium_src-e3b4efb4ee6a8831bd2149ac4210435e6af76e96.tar.gz chromium_src-e3b4efb4ee6a8831bd2149ac4210435e6af76e96.tar.bz2 |
Adds web::Referrer.
This is the //web analogue of content::Referrer.
BUG=422033
TEST=None
Review URL: https://codereview.chromium.org/670203002
Cr-Commit-Position: refs/heads/master@{#300775}
Diffstat (limited to 'ios/web')
-rw-r--r-- | ios/web/ios_web.gyp | 1 | ||||
-rw-r--r-- | ios/web/public/referrer.h | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/ios/web/ios_web.gyp b/ios/web/ios_web.gyp index 1742121..c092fd2 100644 --- a/ios/web/ios_web.gyp +++ b/ios/web/ios_web.gyp @@ -20,6 +20,7 @@ 'public/favicon_status.cc', 'public/favicon_status.h', 'public/navigation_item.h', + 'public/referrer.h', 'public/security_style.h', 'public/ssl_status.cc', 'public/ssl_status.h', diff --git a/ios/web/public/referrer.h b/ios/web/public/referrer.h new file mode 100644 index 0000000..3110c89 --- /dev/null +++ b/ios/web/public/referrer.h @@ -0,0 +1,34 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_WEB_PUBLIC_REFERRER_H_ +#define IOS_WEB_PUBLIC_REFERRER_H_ + +#include "base/logging.h" +#include "url/gurl.h" + +namespace web { + +enum ReferrerPolicy { + ReferrerPolicyAlways, + ReferrerPolicyDefault, + ReferrerPolicyNever, + ReferrerPolicyOrigin, + ReferrerPolicyLast = ReferrerPolicyOrigin +}; + +// This struct holds a referrer URL, as well as the referrer policy to be +// applied to this URL. When passing around referrers that will eventually end +// up being used for URL requests, always use this struct. +struct Referrer { + Referrer(const GURL& url, ReferrerPolicy policy) : url(url), policy(policy) {} + Referrer() : policy(ReferrerPolicyDefault) {} + + GURL url; + ReferrerPolicy policy; +}; + +} // namespace web + +#endif // IOS_WEB_PUBLIC_REFERRER_H_ |