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_entry_impl.h" | 5 #include "content/browser/frame_host/navigation_entry_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/debug/dump_without_crashing.h" | 12 #include "base/debug/dump_without_crashing.h" |
13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "components/url_formatter/url_formatter.h" | 19 #include "components/url_formatter/url_formatter.h" |
20 #include "content/common/content_constants_internal.h" | 20 #include "content/common/content_constants_internal.h" |
21 #include "content/common/navigation_params.h" | 21 #include "content/common/navigation_params.h" |
22 #include "content/common/page_state_serialization.h" | 22 #include "content/common/page_state_serialization.h" |
23 #include "content/common/resource_request_body_impl.h" | 23 #include "content/common/resource_request_body_impl.h" |
24 #include "content/common/site_isolation_policy.h" | 24 #include "content/common/site_isolation_policy.h" |
| 25 #include "content/public/browser/reload_type.h" |
25 #include "content/public/common/browser_side_navigation_policy.h" | 26 #include "content/public/common/browser_side_navigation_policy.h" |
26 #include "content/public/common/content_constants.h" | 27 #include "content/public/common/content_constants.h" |
27 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
28 #include "ui/gfx/text_elider.h" | 29 #include "ui/gfx/text_elider.h" |
29 | 30 |
30 using base::UTF16ToUTF8; | 31 using base::UTF16ToUTF8; |
31 | 32 |
32 namespace content { | 33 namespace content { |
33 | 34 |
34 namespace { | 35 namespace { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 title_(title), | 253 title_(title), |
253 page_id_(page_id), | 254 page_id_(page_id), |
254 transition_type_(transition_type), | 255 transition_type_(transition_type), |
255 restore_type_(RestoreType::NONE), | 256 restore_type_(RestoreType::NONE), |
256 is_overriding_user_agent_(false), | 257 is_overriding_user_agent_(false), |
257 http_status_code_(0), | 258 http_status_code_(0), |
258 is_renderer_initiated_(is_renderer_initiated), | 259 is_renderer_initiated_(is_renderer_initiated), |
259 should_replace_entry_(false), | 260 should_replace_entry_(false), |
260 should_clear_history_list_(false), | 261 should_clear_history_list_(false), |
261 can_load_local_resources_(false), | 262 can_load_local_resources_(false), |
262 frame_tree_node_id_(-1) { | 263 frame_tree_node_id_(-1), |
| 264 reload_type_(ReloadType::NONE) { |
263 #if defined(OS_ANDROID) | 265 #if defined(OS_ANDROID) |
264 has_user_gesture_ = false; | 266 has_user_gesture_ = false; |
265 #endif | 267 #endif |
266 } | 268 } |
267 | 269 |
268 NavigationEntryImpl::~NavigationEntryImpl() { | 270 NavigationEntryImpl::~NavigationEntryImpl() { |
269 } | 271 } |
270 | 272 |
271 int NavigationEntryImpl::GetUniqueID() const { | 273 int NavigationEntryImpl::GetUniqueID() const { |
272 return unique_id_; | 274 return unique_id_; |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 copy->cached_display_title_ = cached_display_title_; | 634 copy->cached_display_title_ = cached_display_title_; |
633 // ResetForCommit: transferred_global_request_id_ | 635 // ResetForCommit: transferred_global_request_id_ |
634 // ResetForCommit: should_replace_entry_ | 636 // ResetForCommit: should_replace_entry_ |
635 copy->redirect_chain_ = redirect_chain_; | 637 copy->redirect_chain_ = redirect_chain_; |
636 // ResetForCommit: should_clear_history_list_ | 638 // ResetForCommit: should_clear_history_list_ |
637 // ResetForCommit: frame_tree_node_id_ | 639 // ResetForCommit: frame_tree_node_id_ |
638 // ResetForCommit: intent_received_timestamp_ | 640 // ResetForCommit: intent_received_timestamp_ |
639 #if defined(OS_ANDROID) | 641 #if defined(OS_ANDROID) |
640 copy->has_user_gesture_ = has_user_gesture_; | 642 copy->has_user_gesture_ = has_user_gesture_; |
641 #endif | 643 #endif |
| 644 // ResetForCommit: reload_type_ |
642 copy->extra_data_ = extra_data_; | 645 copy->extra_data_ = extra_data_; |
643 | 646 |
644 return copy; | 647 return copy; |
645 } | 648 } |
646 | 649 |
647 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( | 650 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( |
648 const FrameNavigationEntry& frame_entry, | 651 const FrameNavigationEntry& frame_entry, |
649 const scoped_refptr<ResourceRequestBodyImpl>& post_body, | 652 const scoped_refptr<ResourceRequestBodyImpl>& post_body, |
650 const GURL& dest_url, | 653 const GURL& dest_url, |
651 const Referrer& dest_referrer, | 654 const Referrer& dest_referrer, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // cleared here. | 749 // cleared here. |
747 // TODO(creis): This state should be moved to NavigationRequest once | 750 // TODO(creis): This state should be moved to NavigationRequest once |
748 // PlzNavigate is enabled. | 751 // PlzNavigate is enabled. |
749 SetPostData(nullptr); | 752 SetPostData(nullptr); |
750 set_is_renderer_initiated(false); | 753 set_is_renderer_initiated(false); |
751 set_transferred_global_request_id(GlobalRequestID()); | 754 set_transferred_global_request_id(GlobalRequestID()); |
752 set_should_replace_entry(false); | 755 set_should_replace_entry(false); |
753 | 756 |
754 set_should_clear_history_list(false); | 757 set_should_clear_history_list(false); |
755 set_frame_tree_node_id(-1); | 758 set_frame_tree_node_id(-1); |
| 759 set_reload_type(ReloadType::NONE); |
756 | 760 |
757 if (frame_entry) | 761 if (frame_entry) |
758 frame_entry->set_source_site_instance(nullptr); | 762 frame_entry->set_source_site_instance(nullptr); |
759 | 763 |
760 #if defined(OS_ANDROID) | 764 #if defined(OS_ANDROID) |
761 // Reset the time stamp so that the metrics are not reported if this entry is | 765 // Reset the time stamp so that the metrics are not reported if this entry is |
762 // loaded again in the future. | 766 // loaded again in the future. |
763 set_intent_received_timestamp(base::TimeTicks()); | 767 set_intent_received_timestamp(base::TimeTicks()); |
764 #endif | 768 #endif |
765 } | 769 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 return node; | 917 return node; |
914 | 918 |
915 // Enqueue any children and keep looking. | 919 // Enqueue any children and keep looking. |
916 for (auto* child : node->children) | 920 for (auto* child : node->children) |
917 work_queue.push(child); | 921 work_queue.push(child); |
918 } | 922 } |
919 return nullptr; | 923 return nullptr; |
920 } | 924 } |
921 | 925 |
922 } // namespace content | 926 } // namespace content |
OLD | NEW |