OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // | 128 // |
129 // If a new entry is created, it will return true and will have filled the | 129 // If a new entry is created, it will return true and will have filled the |
130 // given details structure and broadcast the NOTIFY_NAV_ENTRY_COMMITTED | 130 // given details structure and broadcast the NOTIFY_NAV_ENTRY_COMMITTED |
131 // notification. The caller can then use the details without worrying about | 131 // notification. The caller can then use the details without worrying about |
132 // listening for the notification. | 132 // listening for the notification. |
133 // | 133 // |
134 // In the case that nothing has changed, the details structure is undefined | 134 // In the case that nothing has changed, the details structure is undefined |
135 // and it will return false. | 135 // and it will return false. |
136 bool RendererDidNavigate( | 136 bool RendererDidNavigate( |
137 RenderFrameHost* rfh, | 137 RenderFrameHost* rfh, |
| 138 int32 page_id, |
138 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 139 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
139 LoadCommittedDetails* details); | 140 LoadCommittedDetails* details); |
140 | 141 |
141 // Notifies us that we just became active. This is used by the WebContentsImpl | 142 // Notifies us that we just became active. This is used by the WebContentsImpl |
142 // so that we know to load URLs that were pending as "lazy" loads. | 143 // so that we know to load URLs that were pending as "lazy" loads. |
143 void SetActive(bool is_active); | 144 void SetActive(bool is_active); |
144 | 145 |
145 // Returns true if the given URL would be an in-page navigation (i.e. only | 146 // Returns true if the given URL would be an in-page navigation (i.e. only |
146 // the reference fragment is different) from the "last committed entry". We do | 147 // the reference fragment is different) from the "last committed entry". We do |
147 // not compare it against the "active entry" since the active entry can be | 148 // not compare it against the "active entry" since the active entry can be |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 private: | 223 private: |
223 // |low_water_mark_| is the first time in a sequence of adjusted | 224 // |low_water_mark_| is the first time in a sequence of adjusted |
224 // times and |high_water_mark_| is the last. | 225 // times and |high_water_mark_| is the last. |
225 base::Time low_water_mark_; | 226 base::Time low_water_mark_; |
226 base::Time high_water_mark_; | 227 base::Time high_water_mark_; |
227 }; | 228 }; |
228 | 229 |
229 // Classifies the given renderer navigation (see the NavigationType enum). | 230 // Classifies the given renderer navigation (see the NavigationType enum). |
230 NavigationType ClassifyNavigation( | 231 NavigationType ClassifyNavigation( |
231 RenderFrameHost* rfh, | 232 RenderFrameHost* rfh, |
| 233 int32 page_id, |
232 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) const; | 234 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) const; |
233 | 235 |
234 // Causes the controller to load the specified entry. The function assumes | 236 // Causes the controller to load the specified entry. The function assumes |
235 // ownership of the pointer since it is put in the navigation list. | 237 // ownership of the pointer since it is put in the navigation list. |
236 // NOTE: Do not pass an entry that the controller already owns! | 238 // NOTE: Do not pass an entry that the controller already owns! |
237 void LoadEntry(NavigationEntryImpl* entry); | 239 void LoadEntry(NavigationEntryImpl* entry); |
238 | 240 |
239 // Handlers for the different types of navigation types. They will actually | 241 // Handlers for the different types of navigation types. They will actually |
240 // handle the navigations corresponding to the different NavClasses above. | 242 // handle the navigations corresponding to the different NavClasses above. |
241 // They will NOT broadcast the commit notification, that should be handled by | 243 // They will NOT broadcast the commit notification, that should be handled by |
242 // the caller. | 244 // the caller. |
243 // | 245 // |
244 // RendererDidNavigateAutoSubframe is special, it may not actually change | 246 // RendererDidNavigateAutoSubframe is special, it may not actually change |
245 // anything if some random subframe is loaded. It will return true if anything | 247 // anything if some random subframe is loaded. It will return true if anything |
246 // changed, or false if not. | 248 // changed, or false if not. |
247 // | 249 // |
248 // The functions taking |did_replace_entry| will fill into the given variable | 250 // The functions taking |did_replace_entry| will fill into the given variable |
249 // whether the last entry has been replaced or not. | 251 // whether the last entry has been replaced or not. |
250 // See LoadCommittedDetails.did_replace_entry. | 252 // See LoadCommittedDetails.did_replace_entry. |
251 void RendererDidNavigateToNewPage( | 253 void RendererDidNavigateToNewPage( |
252 RenderFrameHost* rfh, | 254 RenderFrameHost* rfh, |
| 255 int32 page_id, |
253 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 256 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
254 bool replace_entry); | 257 bool replace_entry); |
255 void RendererDidNavigateToExistingPage( | 258 void RendererDidNavigateToExistingPage( |
256 RenderFrameHost* rfh, | 259 RenderFrameHost* rfh, |
| 260 int32 page_id, |
257 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 261 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
258 void RendererDidNavigateToSamePage( | 262 void RendererDidNavigateToSamePage( |
259 RenderFrameHost* rfh, | 263 RenderFrameHost* rfh, |
| 264 int32 page_id, |
260 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 265 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
261 void RendererDidNavigateInPage( | 266 void RendererDidNavigateInPage( |
262 RenderFrameHost* rfh, | 267 RenderFrameHost* rfh, |
| 268 int32 page_id, |
263 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 269 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
264 bool* did_replace_entry); | 270 bool* did_replace_entry); |
265 void RendererDidNavigateNewSubframe( | 271 void RendererDidNavigateNewSubframe( |
266 RenderFrameHost* rfh, | 272 RenderFrameHost* rfh, |
| 273 int32 page_id, |
267 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 274 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
268 bool RendererDidNavigateAutoSubframe( | 275 bool RendererDidNavigateAutoSubframe( |
269 RenderFrameHost* rfh, | 276 RenderFrameHost* rfh, |
| 277 int32 page_id, |
270 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); | 278 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
271 | 279 |
272 // Helper function for code shared between Reload() and ReloadIgnoringCache(). | 280 // Helper function for code shared between Reload() and ReloadIgnoringCache(). |
273 void ReloadInternal(bool check_for_repost, ReloadType reload_type); | 281 void ReloadInternal(bool check_for_repost, ReloadType reload_type); |
274 | 282 |
275 // Actually issues the navigation held in pending_entry. | 283 // Actually issues the navigation held in pending_entry. |
276 void NavigateToPendingEntry(ReloadType reload_type); | 284 void NavigateToPendingEntry(ReloadType reload_type); |
277 | 285 |
278 // Allows the derived class to issue notifications that a load has been | 286 // Allows the derived class to issue notifications that a load has been |
279 // committed. This will fill in the active entry to the details structure. | 287 // committed. This will fill in the active entry to the details structure. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 TimeSmoother time_smoother_; | 416 TimeSmoother time_smoother_; |
409 | 417 |
410 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; | 418 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; |
411 | 419 |
412 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 420 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
413 }; | 421 }; |
414 | 422 |
415 } // namespace content | 423 } // namespace content |
416 | 424 |
417 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 425 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
OLD | NEW |