Don't preload rarely seen large images
[chromium-blink-merge.git] / components / sessions / content / content_serialized_navigation_builder.h
blobb02117a41b5e04b12820188226ed553e2ff00b77
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_
8 #include <vector>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h"
12 #include "components/sessions/sessions_export.h"
14 namespace content {
15 class BrowserContext;
16 class NavigationEntry;
19 namespace sessions {
20 class SerializedNavigationEntry;
22 // Provides methods to convert between SerializedNavigationEntry and content
23 // classes.
24 class SESSIONS_EXPORT ContentSerializedNavigationBuilder {
25 public:
26 // Construct a SerializedNavigationEntry for a particular index from the given
27 // NavigationEntry.
28 static SerializedNavigationEntry FromNavigationEntry(
29 int index,
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,
37 int page_id,
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_