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

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

Issue 1975753006: Pull to refresh: Use new reload type RELOAD_MAIN_RESOURCE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review #14 and #16 Created 4 years, 7 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 entries->clear(); 281 entries->clear();
282 282
283 // And finish the restore. 283 // And finish the restore.
284 FinishRestore(selected_navigation, type); 284 FinishRestore(selected_navigation, type);
285 } 285 }
286 286
287 void NavigationControllerImpl::Reload(bool check_for_repost) { 287 void NavigationControllerImpl::Reload(bool check_for_repost) {
288 ReloadInternal(check_for_repost, RELOAD); 288 ReloadInternal(check_for_repost, RELOAD);
289 } 289 }
290 void NavigationControllerImpl::ReloadToRefreshContent(bool check_for_repost) { 290 void NavigationControllerImpl::ReloadToRefreshContent(bool check_for_repost) {
291 ReloadType type = RELOAD;
291 if (base::FeatureList::IsEnabled( 292 if (base::FeatureList::IsEnabled(
292 features::kNonValidatingReloadOnRefreshContent)) { 293 features::kNonValidatingReloadOnRefreshContent)) {
293 // Cause this reload to behave like NAVIGATION_TYPE_SAME_PAGE (e.g., enter 294 type = RELOAD_MAIN_RESOURCE;
294 // in the omnibox), so that the main resource is cache-validated but all
295 // other resources use the cache as much as possible. This requires
296 // navigating to the current URL in a new pending entry.
297 // TODO(toyoshim): Introduce a new ReloadType for this behavior if it
298 // becomes the default.
299 NavigationEntryImpl* last_committed = GetLastCommittedEntry();
300
301 // If the last committed entry does not exist, or a repost check dialog is
302 // really needed, use a standard reload instead.
303 if (last_committed &&
304 !(check_for_repost && last_committed->GetHasPostData())) {
305 LoadURL(last_committed->GetURL(), last_committed->GetReferrer(),
306 last_committed->GetTransitionType(),
307 last_committed->extra_headers());
308 return;
309 }
310 } 295 }
311 ReloadInternal(check_for_repost, RELOAD); 296 ReloadInternal(check_for_repost, type);
312 } 297 }
313 void NavigationControllerImpl::ReloadBypassingCache(bool check_for_repost) { 298 void NavigationControllerImpl::ReloadBypassingCache(bool check_for_repost) {
314 ReloadInternal(check_for_repost, RELOAD_BYPASSING_CACHE); 299 ReloadInternal(check_for_repost, RELOAD_BYPASSING_CACHE);
315 } 300 }
316 void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) { 301 void NavigationControllerImpl::ReloadOriginalRequestURL(bool check_for_repost) {
317 ReloadInternal(check_for_repost, RELOAD_ORIGINAL_REQUEST_URL); 302 ReloadInternal(check_for_repost, RELOAD_ORIGINAL_REQUEST_URL);
318 } 303 }
319 void NavigationControllerImpl::ReloadDisableLoFi(bool check_for_repost) { 304 void NavigationControllerImpl::ReloadDisableLoFi(bool check_for_repost) {
320 ReloadInternal(check_for_repost, RELOAD_DISABLE_LOFI_MODE); 305 ReloadInternal(check_for_repost, RELOAD_DISABLE_LOFI_MODE);
321 } 306 }
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 } 2055 }
2071 } 2056 }
2072 } 2057 }
2073 2058
2074 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2059 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2075 const base::Callback<base::Time()>& get_timestamp_callback) { 2060 const base::Callback<base::Time()>& get_timestamp_callback) {
2076 get_timestamp_callback_ = get_timestamp_callback; 2061 get_timestamp_callback_ = get_timestamp_callback;
2077 } 2062 }
2078 2063
2079 } // namespace content 2064 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698