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" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "content/browser/frame_host/navigation_controller_delegate.h" | 14 #include "content/browser/frame_host/navigation_controller_delegate.h" |
15 #include "content/browser/ssl/ssl_manager.h" | 15 #include "content/browser/ssl/ssl_manager.h" |
16 #include "content/public/browser/navigation_controller.h" | 16 #include "content/public/browser/navigation_controller.h" |
17 #include "content/public/browser/navigation_type.h" | 17 #include "content/public/browser/navigation_type.h" |
18 | 18 |
19 struct ViewHostMsg_FrameNavigate_Params; | 19 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 class NavigationEntryImpl; | 22 class NavigationEntryImpl; |
23 class RenderViewHost; | 23 class RenderViewHost; |
24 class NavigationEntryScreenshotManager; | 24 class NavigationEntryScreenshotManager; |
25 class SiteInstance; | 25 class SiteInstance; |
26 struct LoadCommittedDetails; | 26 struct LoadCommittedDetails; |
27 | 27 |
28 class CONTENT_EXPORT NavigationControllerImpl | 28 class CONTENT_EXPORT NavigationControllerImpl |
29 : public NON_EXPORTED_BASE(NavigationController) { | 29 : public NON_EXPORTED_BASE(NavigationController) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // | 129 // |
130 // If a new entry is created, it will return true and will have filled the | 130 // If a new entry is created, it will return true and will have filled the |
131 // given details structure and broadcast the NOTIFY_NAV_ENTRY_COMMITTED | 131 // given details structure and broadcast the NOTIFY_NAV_ENTRY_COMMITTED |
132 // notification. The caller can then use the details without worrying about | 132 // notification. The caller can then use the details without worrying about |
133 // listening for the notification. | 133 // listening for the notification. |
134 // | 134 // |
135 // In the case that nothing has changed, the details structure is undefined | 135 // In the case that nothing has changed, the details structure is undefined |
136 // and it will return false. | 136 // and it will return false. |
137 // | 137 // |
138 // TODO(creis): Change RenderViewHost to RenderFrameHost. | 138 // TODO(creis): Change RenderViewHost to RenderFrameHost. |
139 bool RendererDidNavigate(RenderViewHost* rvh, | 139 bool RendererDidNavigate( |
140 const ViewHostMsg_FrameNavigate_Params& params, | 140 RenderViewHost* rvh, |
141 LoadCommittedDetails* details); | 141 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 142 LoadCommittedDetails* details); |
142 | 143 |
143 // Notifies us that we just became active. This is used by the WebContentsImpl | 144 // Notifies us that we just became active. This is used by the WebContentsImpl |
144 // so that we know to load URLs that were pending as "lazy" loads. | 145 // so that we know to load URLs that were pending as "lazy" loads. |
145 void SetActive(bool is_active); | 146 void SetActive(bool is_active); |
146 | 147 |
147 // Returns true if the given URL would be an in-page navigation (i.e. only | 148 // Returns true if the given URL would be an in-page navigation (i.e. only |
148 // the reference fragment is different) from the "last committed entry". We do | 149 // the reference fragment is different) from the "last committed entry". We do |
149 // not compare it against the "active entry" since the active entry can be | 150 // not compare it against the "active entry" since the active entry can be |
150 // pending and in page navigations only happen on committed pages. If there | 151 // pending and in page navigations only happen on committed pages. If there |
151 // is no last committed entry, then nothing will be in-page. | 152 // is no last committed entry, then nothing will be in-page. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 private: | 229 private: |
229 // |low_water_mark_| is the first time in a sequence of adjusted | 230 // |low_water_mark_| is the first time in a sequence of adjusted |
230 // times and |high_water_mark_| is the last. | 231 // times and |high_water_mark_| is the last. |
231 base::Time low_water_mark_; | 232 base::Time low_water_mark_; |
232 base::Time high_water_mark_; | 233 base::Time high_water_mark_; |
233 }; | 234 }; |
234 | 235 |
235 // Classifies the given renderer navigation (see the NavigationType enum). | 236 // Classifies the given renderer navigation (see the NavigationType enum). |
236 NavigationType ClassifyNavigation( | 237 NavigationType ClassifyNavigation( |
237 RenderViewHost* rvh, | 238 RenderViewHost* rvh, |
238 const ViewHostMsg_FrameNavigate_Params& params) const; | 239 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) const; |
239 | 240 |
240 // Causes the controller to load the specified entry. The function assumes | 241 // Causes the controller to load the specified entry. The function assumes |
241 // 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. |
242 // NOTE: Do not pass an entry that the controller already owns! | 243 // NOTE: Do not pass an entry that the controller already owns! |
243 void LoadEntry(NavigationEntryImpl* entry); | 244 void LoadEntry(NavigationEntryImpl* entry); |
244 | 245 |
245 // Handlers for the different types of navigation types. They will actually | 246 // Handlers for the different types of navigation types. They will actually |
246 // handle the navigations corresponding to the different NavClasses above. | 247 // handle the navigations corresponding to the different NavClasses above. |
247 // 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 |
248 // the caller. | 249 // the caller. |
249 // | 250 // |
250 // RendererDidNavigateAutoSubframe is special, it may not actually change | 251 // RendererDidNavigateAutoSubframe is special, it may not actually change |
251 // 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 |
252 // changed, or false if not. | 253 // changed, or false if not. |
253 // | 254 // |
254 // 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 |
255 // whether the last entry has been replaced or not. | 256 // whether the last entry has been replaced or not. |
256 // See LoadCommittedDetails.did_replace_entry. | 257 // See LoadCommittedDetails.did_replace_entry. |
257 // | 258 // |
258 // TODO(creis): Change RenderViewHost to RenderFrameHost. | 259 // TODO(creis): Change RenderViewHost to RenderFrameHost. |
259 void RendererDidNavigateToNewPage( | 260 void RendererDidNavigateToNewPage( |
260 RenderViewHost* rvh, | 261 RenderViewHost* rvh, |
261 const ViewHostMsg_FrameNavigate_Params& params, | 262 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
262 bool replace_entry); | 263 bool replace_entry); |
263 void RendererDidNavigateToExistingPage( | 264 void RendererDidNavigateToExistingPage( |
264 RenderViewHost* rvh, | 265 RenderViewHost* rvh, |
265 const ViewHostMsg_FrameNavigate_Params& params); | 266 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
266 void RendererDidNavigateToSamePage( | 267 void RendererDidNavigateToSamePage( |
267 RenderViewHost* rvh, | 268 RenderViewHost* rvh, |
268 const ViewHostMsg_FrameNavigate_Params& params); | 269 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
269 void RendererDidNavigateInPage( | 270 void RendererDidNavigateInPage( |
270 RenderViewHost* rvh, | 271 RenderViewHost* rvh, |
271 const ViewHostMsg_FrameNavigate_Params& params, | 272 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
272 bool* did_replace_entry); | 273 bool* did_replace_entry); |
273 void RendererDidNavigateNewSubframe( | 274 void RendererDidNavigateNewSubframe( |
274 RenderViewHost* rvh, | 275 RenderViewHost* rvh, |
275 const ViewHostMsg_FrameNavigate_Params& params); | 276 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
276 bool RendererDidNavigateAutoSubframe( | 277 bool RendererDidNavigateAutoSubframe( |
277 RenderViewHost* rvh, | 278 RenderViewHost* rvh, |
278 const ViewHostMsg_FrameNavigate_Params& params); | 279 const FrameHostMsg_DidCommitProvisionalLoad_Params& params); |
279 | 280 |
280 // Helper function for code shared between Reload() and ReloadIgnoringCache(). | 281 // Helper function for code shared between Reload() and ReloadIgnoringCache(). |
281 void ReloadInternal(bool check_for_repost, ReloadType reload_type); | 282 void ReloadInternal(bool check_for_repost, ReloadType reload_type); |
282 | 283 |
283 // Actually issues the navigation held in pending_entry. | 284 // Actually issues the navigation held in pending_entry. |
284 void NavigateToPendingEntry(ReloadType reload_type); | 285 void NavigateToPendingEntry(ReloadType reload_type); |
285 | 286 |
286 // Allows the derived class to issue notifications that a load has been | 287 // Allows the derived class to issue notifications that a load has been |
287 // committed. This will fill in the active entry to the details structure. | 288 // committed. This will fill in the active entry to the details structure. |
288 void NotifyNavigationEntryCommitted(LoadCommittedDetails* details); | 289 void NotifyNavigationEntryCommitted(LoadCommittedDetails* details); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 TimeSmoother time_smoother_; | 414 TimeSmoother time_smoother_; |
414 | 415 |
415 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; | 416 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; |
416 | 417 |
417 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 418 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
418 }; | 419 }; |
419 | 420 |
420 } // namespace content | 421 } // namespace content |
421 | 422 |
422 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 423 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
OLD | NEW |