Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: Source/core/loader/HistoryItem.h

Issue 927213004: Accept options in history APIs to allow scroll restoration to be disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/loader/FrameLoaderTypes.h ('k') | Source/core/loader/HistoryItem.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 11 matching lines...) Expand all
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #ifndef HistoryItem_h 27 #ifndef HistoryItem_h
28 #define HistoryItem_h 28 #define HistoryItem_h
29 29
30 #include "bindings/core/v8/SerializedScriptValue.h" 30 #include "bindings/core/v8/SerializedScriptValue.h"
31 #include "core/CoreExport.h" 31 #include "core/CoreExport.h"
32 #include "core/loader/FrameLoaderTypes.h"
32 #include "platform/geometry/FloatPoint.h" 33 #include "platform/geometry/FloatPoint.h"
33 #include "platform/geometry/IntPoint.h" 34 #include "platform/geometry/IntPoint.h"
34 #include "platform/heap/Handle.h" 35 #include "platform/heap/Handle.h"
35 #include "platform/weborigin/Referrer.h" 36 #include "platform/weborigin/Referrer.h"
36 #include "wtf/RefCounted.h" 37 #include "wtf/RefCounted.h"
37 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 class Document; 42 class Document;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 92
92 void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number ; } 93 void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number ; }
93 long long itemSequenceNumber() const { return m_itemSequenceNumber; } 94 long long itemSequenceNumber() const { return m_itemSequenceNumber; }
94 95
95 void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber = number; } 96 void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber = number; }
96 long long documentSequenceNumber() const { return m_documentSequenceNumber; } 97 long long documentSequenceNumber() const { return m_documentSequenceNumber; }
97 98
98 void setFrameSequenceNumber(long long number) { m_frameSequenceNumber = numb er; } 99 void setFrameSequenceNumber(long long number) { m_frameSequenceNumber = numb er; }
99 long long frameSequenceNumber() const { return m_frameSequenceNumber; } 100 long long frameSequenceNumber() const { return m_frameSequenceNumber; }
100 101
102 void setScrollRestorationType(HistoryScrollRestorationType type) { m_scroll RestorationType = type; }
103 HistoryScrollRestorationType scrollRestorationType() { return m_scrollRestor ationType; }
104
101 void setFormInfoFromRequest(const ResourceRequest&); 105 void setFormInfoFromRequest(const ResourceRequest&);
102 void setFormData(PassRefPtr<FormData>); 106 void setFormData(PassRefPtr<FormData>);
103 void setFormContentType(const AtomicString&); 107 void setFormContentType(const AtomicString&);
104 108
105 bool isCurrentDocument(Document*) const; 109 bool isCurrentDocument(Document*) const;
106 110
107 DECLARE_TRACE(); 111 DECLARE_TRACE();
108 112
109 private: 113 private:
110 HistoryItem(); 114 HistoryItem();
(...skipping 18 matching lines...) Expand all
129 // refer to the same instance of a document. Traversing history from one 133 // refer to the same instance of a document. Traversing history from one
130 // such HistoryItem to another preserves the document. 134 // such HistoryItem to another preserves the document.
131 int64_t m_documentSequenceNumber; 135 int64_t m_documentSequenceNumber;
132 136
133 // If two HistoryItems have the same frame sequence number, then they 137 // If two HistoryItems have the same frame sequence number, then they
134 // refer to the same instance of a Frame. This is used to determine whether 138 // refer to the same instance of a Frame. This is used to determine whether
135 // whether a HistoryItem should navigate an existing frame or create a new 139 // whether a HistoryItem should navigate an existing frame or create a new
136 // one during a history navigation. 140 // one during a history navigation.
137 int64_t m_frameSequenceNumber; 141 int64_t m_frameSequenceNumber;
138 142
143 // Type of the scroll restoration for the history item determines if scroll
144 // position should be restored when it is loaded during history traversal.
145 HistoryScrollRestorationType m_scrollRestorationType;
146
139 // Support for HTML5 History 147 // Support for HTML5 History
140 RefPtr<SerializedScriptValue> m_stateObject; 148 RefPtr<SerializedScriptValue> m_stateObject;
141 149
142 // info used to repost form data 150 // info used to repost form data
143 RefPtr<FormData> m_formData; 151 RefPtr<FormData> m_formData;
144 AtomicString m_formContentType; 152 AtomicString m_formContentType;
145 153
146 }; // class HistoryItem 154 }; // class HistoryItem
147 155
148 } // namespace blink 156 } // namespace blink
149 157
150 #endif // HISTORYITEM_H 158 #endif // HISTORYITEM_H
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoaderTypes.h ('k') | Source/core/loader/HistoryItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698