| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 3 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 class HistoryNode { | 94 class HistoryNode { |
| 95 public: | 95 public: |
| 96 static PassOwnPtr<HistoryNode> create(HistoryEntry*, HistoryItem*); | 96 static PassOwnPtr<HistoryNode> create(HistoryEntry*, HistoryItem*); |
| 97 ~HistoryNode() { } | 97 ~HistoryNode() { } |
| 98 | 98 |
| 99 HistoryNode* addChild(PassRefPtr<HistoryItem>); | 99 HistoryNode* addChild(PassRefPtr<HistoryItem>); |
| 100 PassOwnPtr<HistoryNode> cloneAndReplace(HistoryEntry*, HistoryItem* newItem,
bool clipAtTarget, Frame* targetFrame, Frame* currentFrame); | 100 PassOwnPtr<HistoryNode> cloneAndReplace(HistoryEntry*, HistoryItem* newItem,
bool clipAtTarget, Frame* targetFrame, Frame* currentFrame); |
| 101 HistoryItem* value() { return m_value.get(); } | 101 HistoryItem* value() { return m_value.get(); } |
| 102 void updateValue(PassRefPtr<HistoryItem> item) { m_value = item; } | 102 void updateValue(PassRefPtr<HistoryItem> item) { m_value = item; } |
| 103 const Vector<OwnPtr<HistoryNode> >& children() const { return m_children; } | 103 const Vector<OwnPtr<HistoryNode> >& children() const { return m_children; } |
| 104 void removeChildren(); |
| 104 | 105 |
| 105 private: | 106 private: |
| 106 HistoryNode(HistoryEntry*, HistoryItem*); | 107 HistoryNode(HistoryEntry*, HistoryItem*); |
| 107 | 108 |
| 108 HistoryEntry* m_entry; | 109 HistoryEntry* m_entry; |
| 109 Vector<OwnPtr<HistoryNode> > m_children; | 110 Vector<OwnPtr<HistoryNode> > m_children; |
| 110 RefPtr<HistoryItem> m_value; | 111 RefPtr<HistoryItem> m_value; |
| 112 |
| 111 }; | 113 }; |
| 112 | 114 |
| 113 class HistoryEntry { | 115 class HistoryEntry { |
| 114 public: | 116 public: |
| 115 static PassOwnPtr<HistoryEntry> create(HistoryItem* root); | 117 static PassOwnPtr<HistoryEntry> create(HistoryItem* root); |
| 116 PassOwnPtr<HistoryEntry> cloneAndReplace(HistoryItem* newItem, bool clipAtTa
rget, Frame* targetFrame, Page*); | 118 PassOwnPtr<HistoryEntry> cloneAndReplace(HistoryItem* newItem, bool clipAtTa
rget, Frame* targetFrame, Page*); |
| 117 | 119 |
| 118 HistoryNode* historyNodeForFrame(Frame*); | 120 HistoryNode* historyNodeForFrame(Frame*); |
| 119 HistoryItem* itemForFrame(Frame*); | 121 HistoryItem* itemForFrame(Frame*); |
| 120 HistoryItem* root() const { return m_root->value(); } | 122 HistoryItem* root() const { return m_root->value(); } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 140 // Should only be called by embedder. To request a back/forward | 142 // Should only be called by embedder. To request a back/forward |
| 141 // navigation, call FrameLoaderClient::navigateBackForward(). | 143 // navigation, call FrameLoaderClient::navigateBackForward(). |
| 142 void goToItem(HistoryItem*, ResourceRequestCachePolicy); | 144 void goToItem(HistoryItem*, ResourceRequestCachePolicy); |
| 143 | 145 |
| 144 void updateBackForwardListForFragmentScroll(Frame*, HistoryItem*); | 146 void updateBackForwardListForFragmentScroll(Frame*, HistoryItem*); |
| 145 void updateForCommit(Frame*, HistoryItem*, HistoryCommitType); | 147 void updateForCommit(Frame*, HistoryItem*, HistoryCommitType); |
| 146 | 148 |
| 147 PassRefPtr<HistoryItem> currentItemForExport(); | 149 PassRefPtr<HistoryItem> currentItemForExport(); |
| 148 PassRefPtr<HistoryItem> previousItemForExport(); | 150 PassRefPtr<HistoryItem> previousItemForExport(); |
| 149 HistoryItem* itemForNewChildFrame(Frame*) const; | 151 HistoryItem* itemForNewChildFrame(Frame*) const; |
| 152 void removeChildrenForRedirect(Frame*); |
| 150 | 153 |
| 151 void setDefersLoading(bool); | 154 void setDefersLoading(bool); |
| 152 | 155 |
| 153 private: | 156 private: |
| 154 void goToEntry(PassOwnPtr<HistoryEntry>, ResourceRequestCachePolicy); | 157 void goToEntry(PassOwnPtr<HistoryEntry>, ResourceRequestCachePolicy); |
| 155 typedef HashMap<Frame*, HistoryItem*> HistoryFrameLoadSet; | 158 typedef HashMap<Frame*, HistoryItem*> HistoryFrameLoadSet; |
| 156 void recursiveGoToEntry(Frame*, HistoryFrameLoadSet& sameDocumentLoads, Hist
oryFrameLoadSet& differentDocumentLoads); | 159 void recursiveGoToEntry(Frame*, HistoryFrameLoadSet& sameDocumentLoads, Hist
oryFrameLoadSet& differentDocumentLoads); |
| 157 | 160 |
| 158 void updateForInitialLoadInChildFrame(Frame*, HistoryItem*); | 161 void updateForInitialLoadInChildFrame(Frame*, HistoryItem*); |
| 159 void createNewBackForwardItem(Frame*, HistoryItem*, bool doClip); | 162 void createNewBackForwardItem(Frame*, HistoryItem*, bool doClip); |
| 160 | 163 |
| 161 Page* m_page; | 164 Page* m_page; |
| 162 | 165 |
| 163 OwnPtr<HistoryEntry> m_currentEntry; | 166 OwnPtr<HistoryEntry> m_currentEntry; |
| 164 OwnPtr<HistoryEntry> m_previousEntry; | 167 OwnPtr<HistoryEntry> m_previousEntry; |
| 165 OwnPtr<HistoryEntry> m_provisionalEntry; | 168 OwnPtr<HistoryEntry> m_provisionalEntry; |
| 166 | 169 |
| 167 bool m_defersLoading; | 170 bool m_defersLoading; |
| 168 RefPtr<HistoryItem> m_deferredItem; | 171 RefPtr<HistoryItem> m_deferredItem; |
| 169 ResourceRequestCachePolicy m_deferredCachePolicy; | 172 ResourceRequestCachePolicy m_deferredCachePolicy; |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 } // namespace WebCore | 175 } // namespace WebCore |
| 173 | 176 |
| 174 #endif // HistoryController_h | 177 #endif // HistoryController_h |
| OLD | NEW |