OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Details sent for NOTIFY_NAV_LIST_PRUNED. | 126 // Details sent for NOTIFY_NAV_LIST_PRUNED. |
127 struct PrunedDetails { | 127 struct PrunedDetails { |
128 // If true, count items were removed from the front of the list, otherwise | 128 // If true, count items were removed from the front of the list, otherwise |
129 // count items were removed from the back of the list. | 129 // count items were removed from the back of the list. |
130 bool from_front; | 130 bool from_front; |
131 | 131 |
132 // Number of items removed. | 132 // Number of items removed. |
133 int count; | 133 int count; |
134 }; | 134 }; |
135 | 135 |
| 136 enum ReloadType { |
| 137 NO_RELOAD, // Normal load. |
| 138 RELOAD_VALIDATING_CACHE, // Normal reload. |
| 139 RELOAD_IGNORING_CACHE // Reload all subresources, aka shift-reload. |
| 140 }; |
| 141 |
136 // --------------------------------------------------------------------------- | 142 // --------------------------------------------------------------------------- |
137 | 143 |
138 NavigationController(TabContents* tab_contents, Profile* profile); | 144 NavigationController(TabContents* tab_contents, Profile* profile); |
139 ~NavigationController(); | 145 ~NavigationController(); |
140 | 146 |
141 // Returns the profile for this controller. It can never be NULL. | 147 // Returns the profile for this controller. It can never be NULL. |
142 Profile* profile() const { | 148 Profile* profile() const { |
143 return profile_; | 149 return profile_; |
144 } | 150 } |
145 | 151 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 void GoToIndex(int index); | 285 void GoToIndex(int index); |
280 | 286 |
281 // Navigates to the specified offset from the "current entry". Does nothing if | 287 // Navigates to the specified offset from the "current entry". Does nothing if |
282 // the offset is out of bounds. | 288 // the offset is out of bounds. |
283 void GoToOffset(int offset); | 289 void GoToOffset(int offset); |
284 | 290 |
285 // Reloads the current entry. If |check_for_repost| is true and the current | 291 // Reloads the current entry. If |check_for_repost| is true and the current |
286 // entry has POST data the user is prompted to see if they really want to | 292 // entry has POST data the user is prompted to see if they really want to |
287 // reload the page. In nearly all cases pass in true. | 293 // reload the page. In nearly all cases pass in true. |
288 void Reload(bool check_for_repost); | 294 void Reload(bool check_for_repost); |
| 295 // Like Reload(), but don't use caches (aka "shift-reload"). |
| 296 void ReloadIgnoringCache(bool check_for_repost); |
289 | 297 |
290 // Removing of entries ------------------------------------------------------- | 298 // Removing of entries ------------------------------------------------------- |
291 | 299 |
292 // Removes the entry at the specified |index|. This call dicards any pending | 300 // Removes the entry at the specified |index|. This call dicards any pending |
293 // and transient entries. |default_url| is the URL that the navigation | 301 // and transient entries. |default_url| is the URL that the navigation |
294 // controller navigates to if there are no more entries after the removal. | 302 // controller navigates to if there are no more entries after the removal. |
295 // If |default_url| is empty, we default to "about:blank". | 303 // If |default_url| is empty, we default to "about:blank". |
296 void RemoveEntryAtIndex(int index, const GURL& default_url); | 304 void RemoveEntryAtIndex(int index, const GURL& default_url); |
297 | 305 |
298 // TabContents --------------------------------------------------------------- | 306 // TabContents --------------------------------------------------------------- |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 const ViewHostMsg_FrameNavigate_Params& params); | 432 const ViewHostMsg_FrameNavigate_Params& params); |
425 void RendererDidNavigateToSamePage( | 433 void RendererDidNavigateToSamePage( |
426 const ViewHostMsg_FrameNavigate_Params& params); | 434 const ViewHostMsg_FrameNavigate_Params& params); |
427 void RendererDidNavigateInPage( | 435 void RendererDidNavigateInPage( |
428 const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry); | 436 const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry); |
429 void RendererDidNavigateNewSubframe( | 437 void RendererDidNavigateNewSubframe( |
430 const ViewHostMsg_FrameNavigate_Params& params); | 438 const ViewHostMsg_FrameNavigate_Params& params); |
431 bool RendererDidNavigateAutoSubframe( | 439 bool RendererDidNavigateAutoSubframe( |
432 const ViewHostMsg_FrameNavigate_Params& params); | 440 const ViewHostMsg_FrameNavigate_Params& params); |
433 | 441 |
| 442 // Helper function for code shared between Reload() and ReloadAll(). |
| 443 void ReloadInternal(bool check_for_repost, ReloadType reload_type); |
| 444 |
434 // Actually issues the navigation held in pending_entry. | 445 // Actually issues the navigation held in pending_entry. |
435 void NavigateToPendingEntry(bool reload); | 446 void NavigateToPendingEntry(ReloadType reload_type); |
436 | 447 |
437 // Allows the derived class to issue notifications that a load has been | 448 // Allows the derived class to issue notifications that a load has been |
438 // committed. This will fill in the active entry to the details structure. | 449 // committed. This will fill in the active entry to the details structure. |
439 // | 450 // |
440 // |extra_invalidate_flags| are an additional set of flags (InvalidateTypes) | 451 // |extra_invalidate_flags| are an additional set of flags (InvalidateTypes) |
441 // added to the flags sent to the delegate's NotifyNavigationStateChanged. | 452 // added to the flags sent to the delegate's NotifyNavigationStateChanged. |
442 void NotifyNavigationEntryCommitted(LoadCommittedDetails* details, | 453 void NotifyNavigationEntryCommitted(LoadCommittedDetails* details, |
443 int extra_invalidate_flags); | 454 int extra_invalidate_flags); |
444 | 455 |
445 // Sets the max restored page ID this NavigationController has seen, if it | 456 // Sets the max restored page ID this NavigationController has seen, if it |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // when testing. | 554 // when testing. |
544 static bool check_for_repost_; | 555 static bool check_for_repost_; |
545 | 556 |
546 // The maximum number of entries that a navigation controller can store. | 557 // The maximum number of entries that a navigation controller can store. |
547 static size_t max_entry_count_; | 558 static size_t max_entry_count_; |
548 | 559 |
549 DISALLOW_COPY_AND_ASSIGN(NavigationController); | 560 DISALLOW_COPY_AND_ASSIGN(NavigationController); |
550 }; | 561 }; |
551 | 562 |
552 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ | 563 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_CONTROLLER_H_ |
OLD | NEW |