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_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_
6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_
8 #include "components/sessions/core/serialized_navigation_driver.h"
10 #include "components/sessions/sessions_export.h"
13 template <typename T
> struct DefaultSingletonTraits
;
18 // Provides an implementation of SerializedNavigationDriver that is backed by
20 class SESSIONS_EXPORT_PRIVATE ContentSerializedNavigationDriver
21 : public SerializedNavigationDriver
{
23 ~ContentSerializedNavigationDriver() override
;
25 // Returns the singleton ContentSerializedNavigationDriver. Almost all
26 // callers should use SerializedNavigationDriver::Get() instead.
27 static ContentSerializedNavigationDriver
* GetInstance();
29 // SerializedNavigationDriver implementation.
30 int GetDefaultReferrerPolicy() const override
;
31 bool MapReferrerPolicyToOldValues(int referrer_policy
,
32 int* mapped_referrer_policy
) const override
;
33 bool MapReferrerPolicyToNewValues(int referrer_policy
,
34 int* mapped_referrer_policy
) const override
;
35 std::string
GetSanitizedPageStateForPickle(
36 const SerializedNavigationEntry
* navigation
) const override
;
37 void Sanitize(SerializedNavigationEntry
* navigation
) const override
;
38 std::string
StripReferrerFromPageState(
39 const std::string
& page_state
) const override
;
42 ContentSerializedNavigationDriver();
43 friend struct base::DefaultSingletonTraits
<ContentSerializedNavigationDriver
>;
46 } // namespace sessions
48 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_DRIVER_H_