ios_serialized_navigation_driver.h 1.5 KB

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