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