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" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/strings/string_number_conversions.h" // Temporary | 12 #include "base/strings/string_number_conversions.h" // Temporary |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "cc/base/switches.h" | 16 #include "cc/base/switches.h" |
17 #include "content/browser/browser_url_handler_impl.h" | 17 #include "content/browser/browser_url_handler_impl.h" |
18 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 18 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
19 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 19 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
20 #include "content/browser/frame_host/debug_urls.h" | 20 #include "content/browser/frame_host/debug_urls.h" |
21 #include "content/browser/frame_host/interstitial_page_impl.h" | 21 #include "content/browser/frame_host/interstitial_page_impl.h" |
22 #include "content/browser/frame_host/navigation_entry_impl.h" | 22 #include "content/browser/frame_host/navigation_entry_impl.h" |
23 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" | 23 #include "content/browser/frame_host/navigation_entry_screenshot_manager.h" |
24 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary | 24 #include "content/browser/renderer_host/render_view_host_impl.h" // Temporary |
25 #include "content/browser/site_instance_impl.h" | 25 #include "content/browser/site_instance_impl.h" |
26 #include "content/common/frame_messages.h" | 26 #include "content/common/frame_messages.h" |
27 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
28 #include "content/public/browser/browser_context.h" | 28 #include "content/public/browser/browser_context.h" |
29 #include "content/public/browser/content_browser_client.h" | 29 #include "content/public/browser/content_browser_client.h" |
30 #include "content/public/browser/host_zoom_map.h" | |
30 #include "content/public/browser/invalidate_type.h" | 31 #include "content/public/browser/invalidate_type.h" |
31 #include "content/public/browser/navigation_details.h" | 32 #include "content/public/browser/navigation_details.h" |
32 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/notification_types.h" | 34 #include "content/public/browser/notification_types.h" |
34 #include "content/public/browser/render_widget_host.h" | 35 #include "content/public/browser/render_widget_host.h" |
35 #include "content/public/browser/render_widget_host_view.h" | 36 #include "content/public/browser/render_widget_host_view.h" |
36 #include "content/public/browser/storage_partition.h" | 37 #include "content/public/browser/storage_partition.h" |
37 #include "content/public/browser/user_metrics.h" | 38 #include "content/public/browser/user_metrics.h" |
38 #include "content/public/common/content_client.h" | 39 #include "content/public/common/content_client.h" |
39 #include "content/public/common/content_constants.h" | 40 #include "content/public/common/content_constants.h" |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1053 &url, browser_context_, &needs_update); | 1054 &url, browser_context_, &needs_update); |
1054 new_entry->set_update_virtual_url_with_url(needs_update); | 1055 new_entry->set_update_virtual_url_with_url(needs_update); |
1055 | 1056 |
1056 // When navigating to a new page, give the browser URL handler a chance to | 1057 // 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 | 1058 // 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 | 1059 // to show chrome://bookmarks/#1 when the bookmarks webui extension changes |
1059 // the URL. | 1060 // the URL. |
1060 update_virtual_url = needs_update; | 1061 update_virtual_url = needs_update; |
1061 } | 1062 } |
1062 | 1063 |
1063 if (params.url_is_unreachable) | 1064 if (params.url_is_unreachable) { |
1064 new_entry->set_page_type(PAGE_TYPE_ERROR); | 1065 new_entry->set_page_type(PAGE_TYPE_ERROR); |
1066 HostZoomMap::SendErrorPageZoomLevelRefresh(GetWebContents()); | |
Charlie Reis
2014/10/28 16:36:21
This doesn't seem to belong here, since zoom is un
wjmaclean
2014/10/28 17:37:04
Done.
| |
1067 } | |
1065 new_entry->SetURL(params.url); | 1068 new_entry->SetURL(params.url); |
1066 if (update_virtual_url) | 1069 if (update_virtual_url) |
1067 UpdateVirtualURLToURL(new_entry, params.url); | 1070 UpdateVirtualURLToURL(new_entry, params.url); |
1068 new_entry->SetReferrer(params.referrer); | 1071 new_entry->SetReferrer(params.referrer); |
1069 new_entry->SetPageID(params.page_id); | 1072 new_entry->SetPageID(params.page_id); |
1070 new_entry->SetTransitionType(params.transition); | 1073 new_entry->SetTransitionType(params.transition); |
1071 new_entry->set_site_instance( | 1074 new_entry->set_site_instance( |
1072 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); | 1075 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); |
1073 new_entry->SetHasPostData(params.is_post); | 1076 new_entry->SetHasPostData(params.is_post); |
1074 new_entry->SetPostID(params.post_id); | 1077 new_entry->SetPostID(params.post_id); |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1790 } | 1793 } |
1791 } | 1794 } |
1792 } | 1795 } |
1793 | 1796 |
1794 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1797 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1795 const base::Callback<base::Time()>& get_timestamp_callback) { | 1798 const base::Callback<base::Time()>& get_timestamp_callback) { |
1796 get_timestamp_callback_ = get_timestamp_callback; | 1799 get_timestamp_callback_ = get_timestamp_callback; |
1797 } | 1800 } |
1798 | 1801 |
1799 } // namespace content | 1802 } // namespace content |
OLD | NEW |