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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 &url, browser_context_, &needs_update); | 1053 &url, browser_context_, &needs_update); |
1054 new_entry->set_update_virtual_url_with_url(needs_update); | 1054 new_entry->set_update_virtual_url_with_url(needs_update); |
1055 | 1055 |
1056 // When navigating to a new page, give the browser URL handler a chance to | 1056 // When navigating to a new page, give the browser URL handler a chance to |
1057 // update the virtual URL based on the new URL. For example, this is needed | 1057 // update the virtual URL based on the new URL. For example, this is needed |
1058 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes | 1058 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes |
1059 // the URL. | 1059 // the URL. |
1060 update_virtual_url = needs_update; | 1060 update_virtual_url = needs_update; |
1061 } | 1061 } |
1062 | 1062 |
| 1063 if (params.url_is_unreachable) |
| 1064 new_entry->set_page_type(PAGE_TYPE_ERROR); |
1063 new_entry->SetURL(params.url); | 1065 new_entry->SetURL(params.url); |
1064 if (update_virtual_url) | 1066 if (update_virtual_url) |
1065 UpdateVirtualURLToURL(new_entry, params.url); | 1067 UpdateVirtualURLToURL(new_entry, params.url); |
1066 new_entry->SetReferrer(params.referrer); | 1068 new_entry->SetReferrer(params.referrer); |
1067 new_entry->SetPageID(params.page_id); | 1069 new_entry->SetPageID(params.page_id); |
1068 new_entry->SetTransitionType(params.transition); | 1070 new_entry->SetTransitionType(params.transition); |
1069 new_entry->set_site_instance( | 1071 new_entry->set_site_instance( |
1070 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); | 1072 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); |
1071 new_entry->SetHasPostData(params.is_post); | 1073 new_entry->SetHasPostData(params.is_post); |
1072 new_entry->SetPostID(params.post_id); | 1074 new_entry->SetPostID(params.post_id); |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 } | 1790 } |
1789 } | 1791 } |
1790 } | 1792 } |
1791 | 1793 |
1792 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1794 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1793 const base::Callback<base::Time()>& get_timestamp_callback) { | 1795 const base::Callback<base::Time()>& get_timestamp_callback) { |
1794 get_timestamp_callback_ = get_timestamp_callback; | 1796 get_timestamp_callback_ = get_timestamp_callback; |
1795 } | 1797 } |
1796 | 1798 |
1797 } // namespace content | 1799 } // namespace content |
OLD | NEW |