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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 return NAVIGATION_TYPE_EXISTING_PAGE; | 1001 return NAVIGATION_TYPE_EXISTING_PAGE; |
1002 } | 1002 } |
1003 | 1003 |
1004 if (pending_entry_ && pending_entry_index_ == -1 && | 1004 if (pending_entry_ && pending_entry_index_ == -1 && |
1005 pending_entry_->GetUniqueID() == params.nav_entry_id) { | 1005 pending_entry_->GetUniqueID() == params.nav_entry_id) { |
1006 // In this case, we have a pending entry for a load of a new URL but Blink | 1006 // In this case, we have a pending entry for a load of a new URL but Blink |
1007 // didn't do a new navigation (params.did_create_new_entry). First check to | 1007 // didn't do a new navigation (params.did_create_new_entry). First check to |
1008 // make sure Blink didn't treat a new cross-process navigation as inert, and | 1008 // make sure Blink didn't treat a new cross-process navigation as inert, and |
1009 // thus set params.did_create_new_entry to false. In that case, we must | 1009 // thus set params.did_create_new_entry to false. In that case, we must |
1010 // treat it as NEW since the SiteInstance doesn't match the entry. | 1010 // treat it as NEW since the SiteInstance doesn't match the entry. |
1011 if (GetLastCommittedEntry() && | 1011 if (!GetLastCommittedEntry() || |
1012 GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance()) | 1012 GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance()) |
1013 return NAVIGATION_TYPE_NEW_PAGE; | 1013 return NAVIGATION_TYPE_NEW_PAGE; |
1014 | 1014 |
1015 // Otherwise, this happens when you press enter in the URL bar to reload. We | 1015 // Otherwise, this happens when you press enter in the URL bar to reload. We |
1016 // will create a pending entry, but Blink will convert it to a reload since | 1016 // will create a pending entry, but Blink will convert it to a reload since |
1017 // it's the same page and not create a new entry for it (the user doesn't | 1017 // it's the same page and not create a new entry for it (the user doesn't |
1018 // want to have a new back/forward entry when they do this). Therefore we | 1018 // want to have a new back/forward entry when they do this). Therefore we |
1019 // want to just ignore the pending entry and go back to where we were (the | 1019 // want to just ignore the pending entry and go back to where we were (the |
1020 // "existing entry"). | 1020 // "existing entry"). |
1021 // TODO(creis,avi): Eliminate SAME_PAGE in https://crbug.com/536102. | 1021 // TODO(creis,avi): Eliminate SAME_PAGE in https://crbug.com/536102. |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 } | 2111 } |
2112 } | 2112 } |
2113 } | 2113 } |
2114 | 2114 |
2115 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2115 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
2116 const base::Callback<base::Time()>& get_timestamp_callback) { | 2116 const base::Callback<base::Time()>& get_timestamp_callback) { |
2117 get_timestamp_callback_ = get_timestamp_callback; | 2117 get_timestamp_callback_ = get_timestamp_callback; |
2118 } | 2118 } |
2119 | 2119 |
2120 } // namespace content | 2120 } // namespace content |
OLD | NEW |