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 #include "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1031 // Only make a copy of the pending entry if it is appropriate for the new page | 1031 // Only make a copy of the pending entry if it is appropriate for the new page |
1032 // that was just loaded. We verify this at a coarse grain by checking that | 1032 // that was just loaded. We verify this at a coarse grain by checking that |
1033 // the SiteInstance hasn't been assigned to something else. | 1033 // the SiteInstance hasn't been assigned to something else. |
1034 if (pending_entry_ && | 1034 if (pending_entry_ && |
1035 (!pending_entry_->site_instance() || | 1035 (!pending_entry_->site_instance() || |
1036 pending_entry_->site_instance() == rfh->GetSiteInstance())) { | 1036 pending_entry_->site_instance() == rfh->GetSiteInstance())) { |
1037 new_entry = new NavigationEntryImpl(*pending_entry_); | 1037 new_entry = new NavigationEntryImpl(*pending_entry_); |
1038 | 1038 |
1039 // Don't use the page type from the pending entry. Some interstitial page | 1039 // Don't use the page type from the pending entry. Some interstitial page |
1040 // may have set the type to interstitial. Once we commit, however, the page | 1040 // may have set the type to interstitial. Once we commit, however, the page |
1041 // type must always be normal. | 1041 // type must always be normal or error. |
1042 new_entry->set_page_type(PAGE_TYPE_NORMAL); | 1042 if (new_entry->GetPageType() != PAGE_TYPE_ERROR) |
Charlie Reis
2014/09/22 21:43:53
I thought we were going to call set_page_type(PAGE
wjmaclean
2014/09/23 18:42:38
Hmmm, not here, as this only gets called if there'
| |
1043 new_entry->set_page_type(PAGE_TYPE_NORMAL); | |
1043 update_virtual_url = new_entry->update_virtual_url_with_url(); | 1044 update_virtual_url = new_entry->update_virtual_url_with_url(); |
1044 } else { | 1045 } else { |
1045 new_entry = new NavigationEntryImpl; | 1046 new_entry = new NavigationEntryImpl; |
1046 | 1047 |
1047 // Find out whether the new entry needs to update its virtual URL on URL | 1048 // Find out whether the new entry needs to update its virtual URL on URL |
1048 // change and set up the entry accordingly. This is needed to correctly | 1049 // change and set up the entry accordingly. This is needed to correctly |
1049 // update the virtual URL when replaceState is called after a pushState. | 1050 // update the virtual URL when replaceState is called after a pushState. |
1050 GURL url = params.url; | 1051 GURL url = params.url; |
1051 bool needs_update = false; | 1052 bool needs_update = false; |
1052 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary( | 1053 BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary( |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1788 } | 1789 } |
1789 } | 1790 } |
1790 } | 1791 } |
1791 | 1792 |
1792 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1793 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1793 const base::Callback<base::Time()>& get_timestamp_callback) { | 1794 const base::Callback<base::Time()>& get_timestamp_callback) { |
1794 get_timestamp_callback_ = get_timestamp_callback; | 1795 get_timestamp_callback_ = get_timestamp_callback; |
1795 } | 1796 } |
1796 | 1797 |
1797 } // namespace content | 1798 } // namespace content |
OLD | NEW |