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> |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
673 return CommonNavigationParams( | 673 return CommonNavigationParams( |
674 dest_url, dest_referrer, GetTransitionType(), navigation_type, | 674 dest_url, dest_referrer, GetTransitionType(), navigation_type, |
675 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, | 675 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, |
676 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, | 676 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, |
677 navigation_start, method, post_body ? post_body : post_data_); | 677 navigation_start, method, post_body ? post_body : post_data_); |
678 } | 678 } |
679 | 679 |
680 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() | 680 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() |
681 const { | 681 const { |
682 return StartNavigationParams(extra_headers(), | 682 return StartNavigationParams(extra_headers(), |
683 #if defined(OS_ANDROID) | |
684 has_user_gesture(), | |
685 #endif | |
686 transferred_global_request_id().child_id, | 683 transferred_global_request_id().child_id, |
687 transferred_global_request_id().request_id); | 684 transferred_global_request_id().request_id); |
688 } | 685 } |
689 | 686 |
690 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams( | 687 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams( |
691 const FrameNavigationEntry& frame_entry, | 688 const FrameNavigationEntry& frame_entry, |
692 bool is_same_document_history_load, | 689 bool is_same_document_history_load, |
693 bool is_history_navigation_in_new_child, | 690 bool is_history_navigation_in_new_child, |
694 bool has_subtree_history_items, | 691 bool has_subtree_history_items, |
695 bool has_committed_real_load, | 692 bool has_committed_real_load, |
(...skipping 13 matching lines...) Expand all Loading... | |
709 int current_length_to_send = current_history_list_length; | 706 int current_length_to_send = current_history_list_length; |
710 if (should_clear_history_list()) { | 707 if (should_clear_history_list()) { |
711 // Set the history list related parameters to the same values a | 708 // Set the history list related parameters to the same values a |
712 // NavigationController would return before its first navigation. This will | 709 // NavigationController would return before its first navigation. This will |
713 // fully clear the RenderView's view of the session history. | 710 // fully clear the RenderView's view of the session history. |
714 pending_offset_to_send = -1; | 711 pending_offset_to_send = -1; |
715 current_offset_to_send = -1; | 712 current_offset_to_send = -1; |
716 current_length_to_send = 0; | 713 current_length_to_send = 0; |
717 } | 714 } |
718 | 715 |
716 bool user_gesture = false; | |
717 #if defined(OS_ANDROID) | |
718 user_gesture = has_user_gesture(); | |
nasko
2016/09/30 20:21:47
I wonder why this needs to be only for Android, bu
| |
719 #endif | |
719 RequestNavigationParams request_params( | 720 RequestNavigationParams request_params( |
720 GetIsOverridingUserAgent(), redirects, GetCanLoadLocalResources(), | 721 GetIsOverridingUserAgent(), redirects, GetCanLoadLocalResources(), |
721 base::Time::Now(), frame_entry.page_state(), GetPageID(), GetUniqueID(), | 722 base::Time::Now(), frame_entry.page_state(), GetPageID(), GetUniqueID(), |
722 is_same_document_history_load, is_history_navigation_in_new_child, | 723 is_same_document_history_load, is_history_navigation_in_new_child, |
723 has_subtree_history_items, has_committed_real_load, intended_as_new_entry, | 724 has_subtree_history_items, has_committed_real_load, intended_as_new_entry, |
724 pending_offset_to_send, current_offset_to_send, current_length_to_send, | 725 pending_offset_to_send, current_offset_to_send, current_length_to_send, |
725 IsViewSourceMode(), should_clear_history_list()); | 726 IsViewSourceMode(), should_clear_history_list(), user_gesture); |
726 #if defined(OS_ANDROID) | 727 #if defined(OS_ANDROID) |
727 if (GetDataURLAsString() && | 728 if (GetDataURLAsString() && |
728 GetDataURLAsString()->size() <= kMaxLengthOfDataURLString) { | 729 GetDataURLAsString()->size() <= kMaxLengthOfDataURLString) { |
729 // The number of characters that is enough for validating a data: URI. From | 730 // The number of characters that is enough for validating a data: URI. From |
730 // the GURL's POV, the only important part here is scheme, it doesn't check | 731 // the GURL's POV, the only important part here is scheme, it doesn't check |
731 // the actual content. Thus we can take only the prefix of the url, to avoid | 732 // the actual content. Thus we can take only the prefix of the url, to avoid |
732 // unneeded copying of a potentially long string. | 733 // unneeded copying of a potentially long string. |
733 const size_t kDataUriPrefixMaxLen = 64; | 734 const size_t kDataUriPrefixMaxLen = 64; |
734 GURL data_url(std::string( | 735 GURL data_url(std::string( |
735 GetDataURLAsString()->front_as<char>(), | 736 GetDataURLAsString()->front_as<char>(), |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
913 return node; | 914 return node; |
914 | 915 |
915 // Enqueue any children and keep looking. | 916 // Enqueue any children and keep looking. |
916 for (auto* child : node->children) | 917 for (auto* child : node->children) |
917 work_queue.push(child); | 918 work_queue.push(child); |
918 } | 919 } |
919 return nullptr; | 920 return nullptr; |
920 } | 921 } |
921 | 922 |
922 } // namespace content | 923 } // namespace content |
OLD | NEW |