Port Android relocation packer to chromium build
[chromium-blink-merge.git] / components / sessions / ios / ios_serialized_navigation_builder.h
blob73cbfc9da20f3e53e22e82411c39c1cb2f2e8a57
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_BUILDER_H_
6 #define COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_BUILDER_H_
8 #include <vector>
10 #include "base/memory/scoped_ptr.h"
12 namespace web {
13 class NavigationItem;
16 namespace sessions {
17 class SerializedNavigationEntry;
19 // Provides methods to convert between SerializedNavigationEntry and //ios/web
20 // classes.
21 class IOSSerializedNavigationBuilder {
22 public:
23 // Construct a SerializedNavigationEntry for a particular index from the given
24 // NavigationItem.
25 static SerializedNavigationEntry FromNavigationItem(
26 int index, const web::NavigationItem& item);
28 // Convert the given SerializedNavigationEntry into a NavigationItem with the
29 // given page ID. The NavigationItem will have a transition type of
30 // PAGE_TRANSITION_RELOAD and a new unique ID.
31 static scoped_ptr<web::NavigationItem> ToNavigationItem(
32 const SerializedNavigationEntry* navigation, int page_id);
35 } // namespace sessions
37 #endif // COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_BUILDER_H_