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