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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 } | 613 } |
614 return navigation_start; | 614 return navigation_start; |
615 } | 615 } |
616 | 616 |
617 // PlzNavigate | 617 // PlzNavigate |
618 CommonNavigationParams MakeCommonNavigationParams( | 618 CommonNavigationParams MakeCommonNavigationParams( |
619 const blink::WebFrameClient::NavigationPolicyInfo& info) { | 619 const blink::WebFrameClient::NavigationPolicyInfo& info) { |
620 Referrer referrer( | 620 Referrer referrer( |
621 GURL(info.urlRequest.httpHeaderField( | 621 GURL(info.urlRequest.httpHeaderField( |
622 WebString::fromUTF8("Referer")).latin1()), | 622 WebString::fromUTF8("Referer")).latin1()), |
623 info.urlRequest.referrerPolicy()); | 623 info.urlRequest.getReferrerPolicy()); |
624 | 624 |
625 // Set the ui timestamp for this navigation. Currently the timestamp here is | 625 // Set the ui timestamp for this navigation. Currently the timestamp here is |
626 // only non empty when the navigation was triggered by an Android intent, or | 626 // only non empty when the navigation was triggered by an Android intent, or |
627 // by the user clicking on a link. The timestamp is converted from a double | 627 // by the user clicking on a link. The timestamp is converted from a double |
628 // version supported by blink. It will be passed back to the renderer in the | 628 // version supported by blink. It will be passed back to the renderer in the |
629 // CommitNavigation IPC, and then back to the browser again in the | 629 // CommitNavigation IPC, and then back to the browser again in the |
630 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs. | 630 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs. |
631 base::TimeTicks ui_timestamp = | 631 base::TimeTicks ui_timestamp = |
632 base::TimeTicks() + | 632 base::TimeTicks() + |
633 base::TimeDelta::FromSecondsD(info.urlRequest.uiStartTime()); | 633 base::TimeDelta::FromSecondsD(info.urlRequest.uiStartTime()); |
(...skipping 4175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4809 params.frame_unique_name = item.target().utf8(); | 4809 params.frame_unique_name = item.target().utf8(); |
4810 params.item_sequence_number = item.itemSequenceNumber(); | 4810 params.item_sequence_number = item.itemSequenceNumber(); |
4811 params.document_sequence_number = item.documentSequenceNumber(); | 4811 params.document_sequence_number = item.documentSequenceNumber(); |
4812 | 4812 |
4813 params.is_srcdoc = params.url == content::kAboutSrcDocURL; | 4813 params.is_srcdoc = params.url == content::kAboutSrcDocURL; |
4814 | 4814 |
4815 // If the page contained a client redirect (meta refresh, document.loc...), | 4815 // If the page contained a client redirect (meta refresh, document.loc...), |
4816 // set the referrer appropriately. | 4816 // set the referrer appropriately. |
4817 if (ds->isClientRedirect()) { | 4817 if (ds->isClientRedirect()) { |
4818 params.referrer = | 4818 params.referrer = |
4819 Referrer(params.redirects[0], ds->request().referrerPolicy()); | 4819 Referrer(params.redirects[0], ds->request().getReferrerPolicy()); |
4820 } else { | 4820 } else { |
4821 params.referrer = | 4821 params.referrer = |
4822 RenderViewImpl::GetReferrerFromRequest(frame, ds->request()); | 4822 RenderViewImpl::GetReferrerFromRequest(frame, ds->request()); |
4823 } | 4823 } |
4824 | 4824 |
4825 if (!frame->parent()) { | 4825 if (!frame->parent()) { |
4826 // Top-level navigation. | 4826 // Top-level navigation. |
4827 | 4827 |
4828 // Reset the zoom limits in case a plugin had changed them previously. This | 4828 // Reset the zoom limits in case a plugin had changed them previously. This |
4829 // will also call us back which will cause us to send a message to | 4829 // will also call us back which will cause us to send a message to |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5334 std::vector<GURL> resources_list; | 5334 std::vector<GURL> resources_list; |
5335 std::vector<SavableSubframe> subframes; | 5335 std::vector<SavableSubframe> subframes; |
5336 SavableResourcesResult result(&resources_list, &subframes); | 5336 SavableResourcesResult result(&resources_list, &subframes); |
5337 | 5337 |
5338 if (!GetSavableResourceLinksForFrame( | 5338 if (!GetSavableResourceLinksForFrame( |
5339 frame_, &result, const_cast<const char**>(GetSavableSchemes()))) { | 5339 frame_, &result, const_cast<const char**>(GetSavableSchemes()))) { |
5340 Send(new FrameHostMsg_SavableResourceLinksError(routing_id_)); | 5340 Send(new FrameHostMsg_SavableResourceLinksError(routing_id_)); |
5341 return; | 5341 return; |
5342 } | 5342 } |
5343 | 5343 |
5344 Referrer referrer = | 5344 Referrer referrer = Referrer( |
5345 Referrer(frame_->document().url(), frame_->document().referrerPolicy()); | 5345 frame_->document().url(), frame_->document().getReferrerPolicy()); |
5346 | 5346 |
5347 Send(new FrameHostMsg_SavableResourceLinksResponse( | 5347 Send(new FrameHostMsg_SavableResourceLinksResponse( |
5348 routing_id_, resources_list, referrer, subframes)); | 5348 routing_id_, resources_list, referrer, subframes)); |
5349 } | 5349 } |
5350 | 5350 |
5351 void RenderFrameImpl::OnGetSerializedHtmlWithLocalLinks( | 5351 void RenderFrameImpl::OnGetSerializedHtmlWithLocalLinks( |
5352 const std::map<GURL, base::FilePath>& url_to_local_path, | 5352 const std::map<GURL, base::FilePath>& url_to_local_path, |
5353 const std::map<int, base::FilePath>& frame_routing_id_to_local_path) { | 5353 const std::map<int, base::FilePath>& frame_routing_id_to_local_path) { |
5354 // Convert input to the canonical way of passing a map into a Blink API. | 5354 // Convert input to the canonical way of passing a map into a Blink API. |
5355 LinkRewritingDelegate delegate(url_to_local_path, | 5355 LinkRewritingDelegate delegate(url_to_local_path, |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6667 // event target. Potentially a Pepper plugin will receive the event. | 6667 // event target. Potentially a Pepper plugin will receive the event. |
6668 // In order to tell whether a plugin gets the last mouse event and which it | 6668 // In order to tell whether a plugin gets the last mouse event and which it |
6669 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6669 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6670 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6670 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6671 // |pepper_last_mouse_event_target_|. | 6671 // |pepper_last_mouse_event_target_|. |
6672 pepper_last_mouse_event_target_ = nullptr; | 6672 pepper_last_mouse_event_target_ = nullptr; |
6673 #endif | 6673 #endif |
6674 } | 6674 } |
6675 | 6675 |
6676 } // namespace content | 6676 } // namespace content |
OLD | NEW |