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_BUILDER_H_
6 #define COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_BUILDER_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h"
12 #include "components/sessions/sessions_export.h"
16 class NavigationEntry
;
20 class SerializedNavigationEntry
;
22 // Provides methods to convert between SerializedNavigationEntry and content
24 class SESSIONS_EXPORT ContentSerializedNavigationBuilder
{
26 // Construct a SerializedNavigationEntry for a particular index from the given
28 static SerializedNavigationEntry
FromNavigationEntry(
30 const content::NavigationEntry
& entry
);
32 // Convert the given SerializedNavigationEntry into a NavigationEntry with the
33 // given page ID and context. The NavigationEntry will have a transition type
34 // of PAGE_TRANSITION_RELOAD and a new unique ID.
35 static scoped_ptr
<content::NavigationEntry
> ToNavigationEntry(
36 const SerializedNavigationEntry
* navigation
,
38 content::BrowserContext
* browser_context
);
40 // Converts a set of SerializedNavigationEntrys into a list of
41 // NavigationEntrys with sequential page IDs and the given context.
42 static ScopedVector
<content::NavigationEntry
> ToNavigationEntries(
43 const std::vector
<SerializedNavigationEntry
>& navigations
,
44 content::BrowserContext
* browser_context
);
47 } // namespace sessions
49 #endif // COMPONENTS_SESSIONS_CONTENT_CONTENT_SERIALIZED_NAVIGATION_BUILDER_H_