OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
8 * (http://www.torchmobile.com/) | 8 * (http://www.torchmobile.com/) |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // HistoryNode 2_0 (WebHistoryItem C (url: bar.com)) *REUSED* | 102 // HistoryNode 2_0 (WebHistoryItem C (url: bar.com)) *REUSED* |
103 // HistoryNode 2_1: (WebHistoryItem G (url: bar.com/e)) | 103 // HistoryNode 2_1: (WebHistoryItem G (url: bar.com/e)) |
104 // HistoryNode 2_3: (WebHistoryItem H (url: bar.com/f)) | 104 // HistoryNode 2_3: (WebHistoryItem H (url: bar.com/f)) |
105 // HistoryNode 2_2: (WebHistoryItem E (url: bar.com/c)) *REUSED* | 105 // HistoryNode 2_2: (WebHistoryItem E (url: bar.com/c)) *REUSED* |
106 // | 106 // |
107 class CONTENT_EXPORT HistoryController { | 107 class CONTENT_EXPORT HistoryController { |
108 public: | 108 public: |
109 explicit HistoryController(RenderViewImpl* render_view); | 109 explicit HistoryController(RenderViewImpl* render_view); |
110 ~HistoryController(); | 110 ~HistoryController(); |
111 | 111 |
112 void GoToItem(const blink::WebHistoryItem& item, | 112 void GoToEntry(HistoryEntry* entry, |
113 blink::WebURLRequest::CachePolicy cache_policy); | 113 blink::WebURLRequest::CachePolicy cache_policy); |
114 | 114 |
115 void UpdateForCommit(RenderFrameImpl* frame, | 115 void UpdateForCommit(RenderFrameImpl* frame, |
116 const blink::WebHistoryItem& item, | 116 const blink::WebHistoryItem& item, |
117 blink::WebHistoryCommitType commit_type, | 117 blink::WebHistoryCommitType commit_type, |
118 bool navigation_within_page); | 118 bool navigation_within_page); |
119 | 119 |
120 blink::WebHistoryItem GetCurrentItemForExport(); | 120 HistoryEntry* GetCurrentEntry(); |
121 blink::WebHistoryItem GetPreviousItemForExport(); | 121 HistoryEntry* GetPreviousEntry(); |
122 blink::WebHistoryItem GetItemForNewChildFrame(RenderFrameImpl* frame) const; | 122 blink::WebHistoryItem GetItemForNewChildFrame(RenderFrameImpl* frame) const; |
123 void RemoveChildrenForRedirect(RenderFrameImpl* frame); | 123 void RemoveChildrenForRedirect(RenderFrameImpl* frame); |
124 | 124 |
125 private: | 125 private: |
126 void GoToEntry(HistoryEntry* entry, | |
127 blink::WebURLRequest::CachePolicy cache_policy); | |
128 | |
129 typedef std::vector<std::pair<blink::WebFrame*, blink::WebHistoryItem> > | 126 typedef std::vector<std::pair<blink::WebFrame*, blink::WebHistoryItem> > |
130 HistoryFrameLoadVector; | 127 HistoryFrameLoadVector; |
131 void RecursiveGoToEntry(blink::WebFrame* frame, | 128 void RecursiveGoToEntry(blink::WebFrame* frame, |
132 HistoryFrameLoadVector& sameDocumentLoads, | 129 HistoryFrameLoadVector& sameDocumentLoads, |
133 HistoryFrameLoadVector& differentDocumentLoads); | 130 HistoryFrameLoadVector& differentDocumentLoads); |
134 | 131 |
135 void UpdateForInitialLoadInChildFrame(RenderFrameImpl* frame, | 132 void UpdateForInitialLoadInChildFrame(RenderFrameImpl* frame, |
136 const blink::WebHistoryItem& item); | 133 const blink::WebHistoryItem& item); |
137 void CreateNewBackForwardItem(RenderFrameImpl* frame, | 134 void CreateNewBackForwardItem(RenderFrameImpl* frame, |
138 const blink::WebHistoryItem& item, | 135 const blink::WebHistoryItem& item, |
139 bool clone_children_of_target); | 136 bool clone_children_of_target); |
140 | 137 |
141 RenderViewImpl* render_view_; | 138 RenderViewImpl* render_view_; |
142 | 139 |
143 scoped_ptr<HistoryEntry> current_entry_; | 140 scoped_ptr<HistoryEntry> current_entry_; |
144 scoped_ptr<HistoryEntry> previous_entry_; | 141 scoped_ptr<HistoryEntry> previous_entry_; |
145 scoped_ptr<HistoryEntry> provisional_entry_; | 142 scoped_ptr<HistoryEntry> provisional_entry_; |
146 | 143 |
147 DISALLOW_COPY_AND_ASSIGN(HistoryController); | 144 DISALLOW_COPY_AND_ASSIGN(HistoryController); |
148 }; | 145 }; |
149 | 146 |
150 } // namespace content | 147 } // namespace content |
151 | 148 |
152 #endif // CONTENT_RENDERER_HISTORY_CONTROLLER_H_ | 149 #endif // CONTENT_RENDERER_HISTORY_CONTROLLER_H_ |
OLD | NEW |