Chromium Code Reviews| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 int index = GetEntryIndexWithPageID(instance, page_id); | 407 int index = GetEntryIndexWithPageID(instance, page_id); |
| 408 return (index != -1) ? entries_[index] : nullptr; | 408 return (index != -1) ? entries_[index] : nullptr; |
| 409 } | 409 } |
| 410 | 410 |
| 411 NavigationEntryImpl* | 411 NavigationEntryImpl* |
| 412 NavigationControllerImpl::GetEntryWithUniqueID(int nav_entry_id) const { | 412 NavigationControllerImpl::GetEntryWithUniqueID(int nav_entry_id) const { |
| 413 int index = GetEntryIndexWithUniqueID(nav_entry_id); | 413 int index = GetEntryIndexWithUniqueID(nav_entry_id); |
| 414 return (index != -1) ? entries_[index] : nullptr; | 414 return (index != -1) ? entries_[index] : nullptr; |
| 415 } | 415 } |
| 416 | 416 |
| 417 bool NavigationControllerImpl::HasCommittedRealLoad( | |
| 418 FrameTreeNode* frame_tree_node) const { | |
| 419 NavigationEntryImpl* last_committed = GetLastCommittedEntry(); | |
| 420 return last_committed && last_committed->GetFrameEntry(frame_tree_node); | |
| 421 } | |
| 422 | |
| 423 void NavigationControllerImpl::LoadEntry( | 417 void NavigationControllerImpl::LoadEntry( |
| 424 scoped_ptr<NavigationEntryImpl> entry) { | 418 scoped_ptr<NavigationEntryImpl> entry) { |
| 425 // When navigating to a new page, we don't know for sure if we will actually | 419 // When navigating to a new page, we don't know for sure if we will actually |
| 426 // end up leaving the current page. The new page load could for example | 420 // end up leaving the current page. The new page load could for example |
| 427 // result in a download or a 'no content' response (e.g., a mailto: URL). | 421 // result in a download or a 'no content' response (e.g., a mailto: URL). |
| 428 SetPendingEntry(entry.Pass()); | 422 SetPendingEntry(entry.Pass()); |
| 429 NavigateToPendingEntry(NO_RELOAD); | 423 NavigateToPendingEntry(NO_RELOAD); |
| 430 } | 424 } |
| 431 | 425 |
| 432 void NavigationControllerImpl::SetPendingEntry( | 426 void NavigationControllerImpl::SetPendingEntry( |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 if (!rfh->GetParent()) { | 952 if (!rfh->GetParent()) { |
| 959 return NAVIGATION_TYPE_NEW_PAGE; | 953 return NAVIGATION_TYPE_NEW_PAGE; |
| 960 } | 954 } |
| 961 | 955 |
| 962 // When this is a new subframe navigation, we should have a committed page | 956 // When this is a new subframe navigation, we should have a committed page |
| 963 // in which it's a subframe. This may not be the case when an iframe is | 957 // in which it's a subframe. This may not be the case when an iframe is |
| 964 // navigated on a popup navigated to about:blank (the iframe would be | 958 // navigated on a popup navigated to about:blank (the iframe would be |
| 965 // written into the popup by script on the main page). For these cases, | 959 // written into the popup by script on the main page). For these cases, |
| 966 // there isn't any navigation stuff we can do, so just ignore it. | 960 // there isn't any navigation stuff we can do, so just ignore it. |
| 967 if (!GetLastCommittedEntry()) | 961 if (!GetLastCommittedEntry()) |
| 968 return NAVIGATION_TYPE_NAV_IGNORE; | 962 return NAVIGATION_TYPE_NAV_IGNORE; |
|
Charlie Reis
2015/07/23 19:57:34
I think all the IGNORE cases here are when the mai
Avi (use Gerrit)
2015/07/23 20:27:58
What horrible edge case is it where the there is n
Charlie Reis
2015/07/23 22:02:22
Sorry, reparse that as "when the main frame has no
| |
| 969 | 963 |
| 970 // Valid subframe navigation. | 964 // Valid subframe navigation. |
| 971 return NAVIGATION_TYPE_NEW_SUBFRAME; | 965 return NAVIGATION_TYPE_NEW_SUBFRAME; |
| 972 } | 966 } |
| 973 | 967 |
| 974 // We only clear the session history when navigating to a new page. | 968 // We only clear the session history when navigating to a new page. |
| 975 DCHECK(!params.history_list_was_cleared); | 969 DCHECK(!params.history_list_was_cleared); |
| 976 | 970 |
| 977 if (rfh->GetParent()) { | 971 if (rfh->GetParent()) { |
| 978 // All manual subframes would be did_create_new_entry and handled above, so | 972 // All manual subframes would be did_create_new_entry and handled above, so |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1988 } | 1982 } |
| 1989 } | 1983 } |
| 1990 } | 1984 } |
| 1991 | 1985 |
| 1992 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1986 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 1993 const base::Callback<base::Time()>& get_timestamp_callback) { | 1987 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 1994 get_timestamp_callback_ = get_timestamp_callback; | 1988 get_timestamp_callback_ = get_timestamp_callback; |
| 1995 } | 1989 } |
| 1996 | 1990 |
| 1997 } // namespace content | 1991 } // namespace content |
| OLD | NEW |