Port Android relocation packer to chromium build
[chromium-blink-merge.git] / components / sessions / ios / ios_serialized_navigation_driver.h
blobaf7597347820077ba580f03996e603397e8287d3
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_
6 #define COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_
8 #include "components/sessions/core/serialized_navigation_driver.h"
10 template <typename T> struct DefaultSingletonTraits;
12 namespace sessions {
14 // Provides an iOS implementation of SerializedNavigationDriver that is backed
15 // by //ios/web classes.
16 class IOSSerializedNavigationDriver
17 : public SerializedNavigationDriver {
18 public:
19 ~IOSSerializedNavigationDriver() override;
21 // Returns the singleton IOSSerializedNavigationDriver. Almost all
22 // callers should use SerializedNavigationDriver::Get() instead.
23 static IOSSerializedNavigationDriver* GetInstance();
25 // SerializedNavigationDriver implementation.
26 int GetDefaultReferrerPolicy() const override;
27 bool MapReferrerPolicyToOldValues(int referrer_policy,
28 int* mapped_referrer_policy) const override;
29 bool MapReferrerPolicyToNewValues(int referrer_policy,
30 int* mapped_referrer_policy) const override;
31 std::string GetSanitizedPageStateForPickle(
32 const SerializedNavigationEntry* navigation) const override;
33 void Sanitize(SerializedNavigationEntry* navigation) const override;
34 std::string StripReferrerFromPageState(
35 const std::string& page_state) const override;
37 private:
38 IOSSerializedNavigationDriver();
39 friend struct DefaultSingletonTraits<IOSSerializedNavigationDriver>;
42 } // namespace sessions
44 #endif // COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_