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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
566 copy->redirect_chain_ = redirect_chain_; | 567 copy->redirect_chain_ = redirect_chain_; |
567 // ResetForCommit: should_clear_history_list_ | 568 // ResetForCommit: should_clear_history_list_ |
568 // ResetForCommit: frame_tree_node_id_ | 569 // ResetForCommit: frame_tree_node_id_ |
569 // ResetForCommit: intent_received_timestamp_ | 570 // ResetForCommit: intent_received_timestamp_ |
570 copy->extra_data_ = extra_data_; | 571 copy->extra_data_ = extra_data_; |
571 | 572 |
572 return copy; | 573 return copy; |
573 } | 574 } |
574 | 575 |
575 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( | 576 CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( |
577 const FrameNavigationEntry& frame_entry, | |
576 const GURL& dest_url, | 578 const GURL& dest_url, |
577 const Referrer& dest_referrer, | 579 const Referrer& dest_referrer, |
578 FrameMsg_Navigate_Type::Value navigation_type, | 580 FrameMsg_Navigate_Type::Value navigation_type, |
579 LoFiState lofi_state, | 581 LoFiState lofi_state, |
580 const base::TimeTicks& navigation_start) const { | 582 const base::TimeTicks& navigation_start) const { |
581 FrameMsg_UILoadMetricsReportType::Value report_type = | 583 FrameMsg_UILoadMetricsReportType::Value report_type = |
582 FrameMsg_UILoadMetricsReportType::NO_REPORT; | 584 FrameMsg_UILoadMetricsReportType::NO_REPORT; |
583 base::TimeTicks ui_timestamp = base::TimeTicks(); | 585 base::TimeTicks ui_timestamp = base::TimeTicks(); |
584 #if defined(OS_ANDROID) | 586 #if defined(OS_ANDROID) |
585 if (!intent_received_timestamp().is_null()) | 587 if (!intent_received_timestamp().is_null()) |
586 report_type = FrameMsg_UILoadMetricsReportType::REPORT_INTENT; | 588 report_type = FrameMsg_UILoadMetricsReportType::REPORT_INTENT; |
587 ui_timestamp = intent_received_timestamp(); | 589 ui_timestamp = intent_received_timestamp(); |
588 #endif | 590 #endif |
589 | 591 |
592 std::string method; | |
593 | |
594 if (IsBrowserSideNavigationEnabled()) | |
Charlie Reis
2016/05/11 00:00:23
At some point, I think we'll need this in all UseS
clamy
2016/05/11 08:54:41
Added a TODO. I prefer this CL to stay focused on
| |
595 method = frame_entry.method(); | |
596 else | |
597 method = GetHasPostData() ? "POST" : "GET"; | |
598 | |
590 return CommonNavigationParams( | 599 return CommonNavigationParams( |
591 dest_url, dest_referrer, GetTransitionType(), navigation_type, | 600 dest_url, dest_referrer, GetTransitionType(), navigation_type, |
592 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, | 601 !IsViewSourceMode(), should_replace_entry(), ui_timestamp, report_type, |
593 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, | 602 GetBaseURLForDataURL(), GetHistoryURLForDataURL(), lofi_state, |
594 navigation_start, GetHasPostData() ? "POST" : "GET"); | 603 navigation_start, method); |
595 } | 604 } |
596 | 605 |
597 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() | 606 StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() |
598 const { | 607 const { |
599 std::vector<unsigned char> browser_initiated_post_data; | 608 std::vector<unsigned char> browser_initiated_post_data; |
600 if (GetBrowserInitiatedPostData()) { | 609 if (GetBrowserInitiatedPostData()) { |
601 browser_initiated_post_data.assign( | 610 browser_initiated_post_data.assign( |
602 GetBrowserInitiatedPostData()->front(), | 611 GetBrowserInitiatedPostData()->front(), |
603 GetBrowserInitiatedPostData()->front() + | 612 GetBrowserInitiatedPostData()->front() + |
604 GetBrowserInitiatedPostData()->size()); | 613 GetBrowserInitiatedPostData()->size()); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
757 return node; | 766 return node; |
758 | 767 |
759 // Enqueue any children and keep looking. | 768 // Enqueue any children and keep looking. |
760 for (auto& child : node->children) | 769 for (auto& child : node->children) |
761 work_queue.push(child); | 770 work_queue.push(child); |
762 } | 771 } |
763 return nullptr; | 772 return nullptr; |
764 } | 773 } |
765 | 774 |
766 } // namespace content | 775 } // namespace content |
OLD | NEW |