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

Unified Diff: ios/web/public/referrer_util.h

Issue 986743003: Upstream (most of) ios/web/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace comment Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/public/interstitials/web_interstitial_delegate.h ('k') | ios/web/public/referrer_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/referrer_util.h
diff --git a/ios/web/public/referrer_util.h b/ios/web/public/referrer_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..3500dfc231a6a68f31ebd43a068f5c856f842373
--- /dev/null
+++ b/ios/web/public/referrer_util.h
@@ -0,0 +1,40 @@
+// Copyright 2013 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_UTIL_H_
+#define IOS_WEB_PUBLIC_REFERRER_UTIL_H_
+
+#include <string>
+
+#include "ios/web/public/referrer.h"
+#include "net/url_request/url_request.h"
+
+class GURL;
+
+namespace web {
+
+// Returns a sanitized version of |referrer| for use in a Referer header.
+GURL ReferrerForHeader(const GURL& referrer);
+
+// Returns the string that should be sent as the Referer header value for
+// navigating to |destination| from the given referrer, taking the referrer
+// policy into account. Returns an empty string if no Referer should be sent.
+std::string ReferrerHeaderValueForNavigation(
+ const GURL& destination,
+ const web::Referrer& referrer);
+
+// Returns the policy that should be used to process subsequent forwards, if
+// any.
+net::URLRequest::ReferrerPolicy PolicyForNavigation(
+ const GURL& destination,
+ const web::Referrer& referrer);
+
+// Returns the WebReferrerPolicy corresponding to the given policy string
+// (e.g., 'always', 'never', 'origin', 'default'). The string is assumed to
+// be lowercase already. Unrecognized values will be treated as Default.
+ReferrerPolicy ReferrerPolicyFromString(const std::string& policy);
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_REFERRER_UTIL_H_
« no previous file with comments | « ios/web/public/interstitials/web_interstitial_delegate.h ('k') | ios/web/public/referrer_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698