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/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "components/url_formatter/url_formatter.h" | 17 #include "components/url_formatter/url_formatter.h" |
18 #include "content/common/content_constants_internal.h" | 18 #include "content/common/content_constants_internal.h" |
19 #include "content/common/navigation_params.h" | 19 #include "content/common/navigation_params.h" |
20 #include "content/common/page_state_serialization.h" | 20 #include "content/common/page_state_serialization.h" |
21 #include "content/common/site_isolation_policy.h" | 21 #include "content/common/site_isolation_policy.h" |
| 22 #include "content/public/common/browser_side_navigation_policy.h" |
22 #include "content/public/common/content_constants.h" | 23 #include "content/public/common/content_constants.h" |
23 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
24 #include "ui/gfx/text_elider.h" | 25 #include "ui/gfx/text_elider.h" |
25 | 26 |
26 using base::UTF16ToUTF8; | 27 using base::UTF16ToUTF8; |
27 | 28 |
28 namespace content { | 29 namespace content { |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 copy->redirect_chain_ = redirect_chain_; | 563 copy->redirect_chain_ = redirect_chain_; |
563 // ResetForCommit: should_clear_history_list_ | 564 // ResetForCommit: should_clear_history_list_ |
564 // ResetForCommit: frame_tree_node_id_ | 565 // ResetForCommit: frame_tree_node_id_ |
565 // ResetForCommit: intent_received_timestamp_ | 566 // ResetForCommit: intent_received_timestamp_ |
566 copy->extra_data_ = extra_data_; | 567 copy->extra_data_ = extra_data_; |
567 | 568 |
568 return copy; | 569 return copy; |
569 } | 570 } |
570 | 571 |
571 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( | 572 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( |
| 573 const FrameNavigationEntry& frame_entry, |
572 const GURL& dest_url, | 574 const GURL& dest_url, |
573 const Referrer& dest_referrer, | 575 const Referrer& dest_referrer, |
574 FrameMsg_Navigate_Type::Value navigation_type, | 576 FrameMsg_Navigate_Type::Value navigation_type, |
575 LoFiState lofi_state, | 577 LoFiState lofi_state, |
576 const base::TimeTicks& navigation_start) const { | 578 const base::TimeTicks& navigation_start) const { |
577 FrameMsg_UILoadMetricsReportType::Value report_type = | 579 FrameMsg_UILoadMetricsReportType::Value report_type = |
578 FrameMsg_UILoadMetricsReportType::NO_REPORT; | 580 FrameMsg_UILoadMetricsReportType::NO_REPORT; |
579 base::TimeTicks ui_timestamp = base::TimeTicks(); | 581 base::TimeTicks ui_timestamp = base::TimeTicks(); |
580 #if defined(OS_ANDROID) | 582 #if defined(OS_ANDROID) |
581 if (!intent_received_timestamp().is_null()) | 583 if (!intent_received_timestamp().is_null()) |
582 report_type = FrameMsg_UILoadMetricsReportType::REPORT_INTENT; | 584 report_type = FrameMsg_UILoadMetricsReportType::REPORT_INTENT; |
583 ui_timestamp = intent_received_timestamp(); | 585 ui_timestamp = intent_received_timestamp(); |
584 #endif | 586 #endif |
585 | 587 |
| 588 std::string method; |
| 589 |
| 590 // TODO(clamy): Consult the FrameNavigationEntry in all modes that use |
| 591 // subframe navigation entries. |
| 592 if (IsBrowserSideNavigationEnabled()) |
| 593 method = frame_entry.method(); |
| 594 else |
| 595 method = GetHasPostData() ? "POST" : "GET"; |
| 596 |
586 return CommonNavigationParams( | 597 return CommonNavigationParams( |
587 dest_url, dest_referrer, GetTransitionType(), navigation_type, | 598 dest_url, dest_referrer, GetTransitionType(), navigation_type, |
588 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, | 599 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, |
589 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, | 600 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, |
590 navigation_start, GetHasPostData() ? "POST" : "GET"); | 601 navigation_start, method); |
591 } | 602 } |
592 | 603 |
593 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() | 604 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() |
594 const { | 605 const { |
595 std::vector<unsigned char> browser_initiated_post_data; | 606 std::vector<unsigned char> browser_initiated_post_data; |
596 if (GetBrowserInitiatedPostData()) { | 607 if (GetBrowserInitiatedPostData()) { |
597 browser_initiated_post_data.assign( | 608 browser_initiated_post_data.assign( |
598 GetBrowserInitiatedPostData()->front(), | 609 GetBrowserInitiatedPostData()->front(), |
599 GetBrowserInitiatedPostData()->front() + | 610 GetBrowserInitiatedPostData()->front() + |
600 GetBrowserInitiatedPostData()->size()); | 611 GetBrowserInitiatedPostData()->size()); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 return node; | 769 return node; |
759 | 770 |
760 // Enqueue any children and keep looking. | 771 // Enqueue any children and keep looking. |
761 for (auto& child : node->children) | 772 for (auto& child : node->children) |
762 work_queue.push(child); | 773 work_queue.push(child); |
763 } | 774 } |
764 return nullptr; | 775 return nullptr; |
765 } | 776 } |
766 | 777 |
767 } // namespace content | 778 } // namespace content |
OLD | NEW |