Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 10870073: Change how NavigationController reloads transient entries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove outdated comment Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/navigation_controller_impl.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" // Temporary 9 #include "base/string_number_conversions.h" // Temporary
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 void NavigationControllerImpl::ReloadIgnoringCache(bool check_for_repost) { 242 void NavigationControllerImpl::ReloadIgnoringCache(bool check_for_repost) {
243 ReloadInternal(check_for_repost, RELOAD_IGNORING_CACHE); 243 ReloadInternal(check_for_repost, RELOAD_IGNORING_CACHE);
244 } 244 }
245 void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) { 245 void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) {
246 ReloadInternal(check_for_repost, RELOAD_ORIGINAL_REQUEST_URL); 246 ReloadInternal(check_for_repost, RELOAD_ORIGINAL_REQUEST_URL);
247 } 247 }
248 248
249 void NavigationControllerImpl::ReloadInternal(bool check_for_repost, 249 void NavigationControllerImpl::ReloadInternal(bool check_for_repost,
250 ReloadType reload_type) { 250 ReloadType reload_type) {
251 // Reloading a transient entry does nothing. 251 if (transient_entry_index_ != -1) {
252 if (transient_entry_index_ != -1) 252 // Interstitials are reloaded by navigating back to their URLs.
Charlie Reis 2012/08/27 17:25:35 Maybe clarify this as "If an interstitial is showi
mmenke 2012/08/27 17:37:03 Done.
253 content::NavigationEntryImpl* active_entry =
254 NavigationEntryImpl::FromNavigationEntry(GetActiveEntry());
255 if (!active_entry)
256 return;
257 LoadURL(active_entry->GetURL(),
258 content::Referrer(),
259 content::PAGE_TRANSITION_RELOAD,
260 active_entry->extra_headers());
253 return; 261 return;
262 }
254 263
255 DiscardNonCommittedEntriesInternal(); 264 DiscardNonCommittedEntriesInternal();
256 int current_index = GetCurrentEntryIndex(); 265 int current_index = GetCurrentEntryIndex();
257 // If we are no where, then we can't reload. TODO(darin): We should add a 266 // If we are no where, then we can't reload. TODO(darin): We should add a
258 // CanReload method. 267 // CanReload method.
259 if (current_index == -1) { 268 if (current_index == -1) {
260 return; 269 return;
261 } 270 }
262 271
263 if (g_check_for_repost && check_for_repost && 272 if (g_check_for_repost && check_for_repost &&
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 for (int i = 0; i < max_index; i++) { 1556 for (int i = 0; i < max_index; i++) {
1548 // When cloning a tab, copy all entries except interstitial pages 1557 // When cloning a tab, copy all entries except interstitial pages
1549 if (source.entries_[i].get()->GetPageType() != 1558 if (source.entries_[i].get()->GetPageType() !=
1550 content::PAGE_TYPE_INTERSTITIAL) { 1559 content::PAGE_TYPE_INTERSTITIAL) {
1551 entries_.insert(entries_.begin() + insert_index++, 1560 entries_.insert(entries_.begin() + insert_index++,
1552 linked_ptr<NavigationEntryImpl>( 1561 linked_ptr<NavigationEntryImpl>(
1553 new NavigationEntryImpl(*source.entries_[i]))); 1562 new NavigationEntryImpl(*source.entries_[i])));
1554 } 1563 }
1555 } 1564 }
1556 } 1565 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698