| 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 /* | 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 if (current_index != -1) { | 320 if (current_index != -1) { |
| 321 entry = GetEntryAtIndex(current_index); | 321 entry = GetEntryAtIndex(current_index); |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 // If we are no where, then we can't reload. TODO(darin): We should add a | 325 // If we are no where, then we can't reload. TODO(darin): We should add a |
| 326 // CanReload method. | 326 // CanReload method. |
| 327 if (!entry) | 327 if (!entry) |
| 328 return; | 328 return; |
| 329 | 329 |
| 330 if (reload_type == NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL && | |
| 331 entry->GetOriginalRequestURL().is_valid() && !entry->GetHasPostData()) { | |
| 332 // We may have been redirected when navigating to the current URL. | |
| 333 // Use the URL the user originally intended to visit, if it's valid and if a | |
| 334 // POST wasn't involved; the latter case avoids issues with sending data to | |
| 335 // the wrong page. | |
| 336 entry->SetURL(entry->GetOriginalRequestURL()); | |
| 337 entry->SetReferrer(Referrer()); | |
| 338 } | |
| 339 | |
| 340 if (g_check_for_repost && check_for_repost && | 330 if (g_check_for_repost && check_for_repost && |
| 341 entry->GetHasPostData()) { | 331 entry->GetHasPostData()) { |
| 342 // The user is asking to reload a page with POST data. Prompt to make sure | 332 // The user is asking to reload a page with POST data. Prompt to make sure |
| 343 // they really want to do this. If they do, the dialog will call us back | 333 // they really want to do this. If they do, the dialog will call us back |
| 344 // with check_for_repost = false. | 334 // with check_for_repost = false. |
| 345 delegate_->NotifyBeforeFormRepostWarningShow(); | 335 delegate_->NotifyBeforeFormRepostWarningShow(); |
| 346 | 336 |
| 347 pending_reload_ = reload_type; | 337 pending_reload_ = reload_type; |
| 348 delegate_->ActivateAndShowRepostFormWarningDialog(); | 338 delegate_->ActivateAndShowRepostFormWarningDialog(); |
| 349 } else { | 339 } else { |
| (...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 } | 1997 } |
| 2008 } | 1998 } |
| 2009 } | 1999 } |
| 2010 | 2000 |
| 2011 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2001 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2012 const base::Callback<base::Time()>& get_timestamp_callback) { | 2002 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2013 get_timestamp_callback_ = get_timestamp_callback; | 2003 get_timestamp_callback_ = get_timestamp_callback; |
| 2014 } | 2004 } |
| 2015 | 2005 |
| 2016 } // namespace content | 2006 } // namespace content |
| OLD | NEW |