Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / components / sessions / ios / ios_serialized_navigation_builder.h
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
5 #ifndef COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_BUILDER_H_
6 #define COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_BUILDER_H_
7
8 #include <vector>
9
10 #include "base/memory/scoped_ptr.h"
11
12 namespace web {
13 class NavigationItem;
14 }
15
16 namespace sessions {
17 class SerializedNavigationEntry;
18
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);
27
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);
33 };
34
35 }  // namespace sessions
36
37 #endif  // COMPONENTS_SESSIONS_IOS_IOS_SERIALIZED_NAVIGATION_BUILDER_H_