| 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 COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_ | 5 #ifndef COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_ |
| 6 #define COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_ | 6 #define COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_ |
| 7 | 7 |
| 8 #include "components/sessions/core/serialized_navigation_driver.h" | 8 #include "components/sessions/core/serialized_navigation_driver.h" |
| 9 | 9 |
| 10 namespace base { |
| 10 template <typename T> struct DefaultSingletonTraits; | 11 template <typename T> struct DefaultSingletonTraits; |
| 12 } |
| 11 | 13 |
| 12 namespace sessions { | 14 namespace sessions { |
| 13 | 15 |
| 14 // Provides an iOS implementation of SerializedNavigationDriver that is backed | 16 // Provides an iOS implementation of SerializedNavigationDriver that is backed |
| 15 // by //ios/web classes. | 17 // by //ios/web classes. |
| 16 class IOSSerializedNavigationDriver | 18 class IOSSerializedNavigationDriver |
| 17 : public SerializedNavigationDriver { | 19 : public SerializedNavigationDriver { |
| 18 public: | 20 public: |
| 19 ~IOSSerializedNavigationDriver() override; | 21 ~IOSSerializedNavigationDriver() override; |
| 20 | 22 |
| 21 // Returns the singleton IOSSerializedNavigationDriver. Almost all | 23 // Returns the singleton IOSSerializedNavigationDriver. Almost all |
| 22 // callers should use SerializedNavigationDriver::Get() instead. | 24 // callers should use SerializedNavigationDriver::Get() instead. |
| 23 static IOSSerializedNavigationDriver* GetInstance(); | 25 static IOSSerializedNavigationDriver* GetInstance(); |
| 24 | 26 |
| 25 // SerializedNavigationDriver implementation. | 27 // SerializedNavigationDriver implementation. |
| 26 int GetDefaultReferrerPolicy() const override; | 28 int GetDefaultReferrerPolicy() const override; |
| 27 bool MapReferrerPolicyToOldValues(int referrer_policy, | 29 bool MapReferrerPolicyToOldValues(int referrer_policy, |
| 28 int* mapped_referrer_policy) const override; | 30 int* mapped_referrer_policy) const override; |
| 29 bool MapReferrerPolicyToNewValues(int referrer_policy, | 31 bool MapReferrerPolicyToNewValues(int referrer_policy, |
| 30 int* mapped_referrer_policy) const override; | 32 int* mapped_referrer_policy) const override; |
| 31 std::string GetSanitizedPageStateForPickle( | 33 std::string GetSanitizedPageStateForPickle( |
| 32 const SerializedNavigationEntry* navigation) const override; | 34 const SerializedNavigationEntry* navigation) const override; |
| 33 void Sanitize(SerializedNavigationEntry* navigation) const override; | 35 void Sanitize(SerializedNavigationEntry* navigation) const override; |
| 34 std::string StripReferrerFromPageState( | 36 std::string StripReferrerFromPageState( |
| 35 const std::string& page_state) const override; | 37 const std::string& page_state) const override; |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 IOSSerializedNavigationDriver(); | 40 IOSSerializedNavigationDriver(); |
| 39 friend struct DefaultSingletonTraits<IOSSerializedNavigationDriver>; | 41 friend struct base::DefaultSingletonTraits<IOSSerializedNavigationDriver>; |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 } // namespace sessions | 44 } // namespace sessions |
| 43 | 45 |
| 44 #endif // COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_ | 46 #endif // COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_DRIVER_H_ |
| OLD | NEW |