Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2433743004: PlzNavigate: Transmit referrer into FrameNavigationEntry. (Closed)
Patch Set: Merge tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4792 matching lines...) Expand 10 before | Expand all | Expand 10 after
4803 if (params.method == "POST") 4803 if (params.method == "POST")
4804 params.post_id = post_id; 4804 params.post_id = post_id;
4805 } 4805 }
4806 4806
4807 params.frame_unique_name = item.target().utf8(); 4807 params.frame_unique_name = item.target().utf8();
4808 params.item_sequence_number = item.itemSequenceNumber(); 4808 params.item_sequence_number = item.itemSequenceNumber();
4809 params.document_sequence_number = item.documentSequenceNumber(); 4809 params.document_sequence_number = item.documentSequenceNumber();
4810 4810
4811 params.is_srcdoc = params.url == content::kAboutSrcDocURL; 4811 params.is_srcdoc = params.url == content::kAboutSrcDocURL;
4812 4812
4813 // If the page contained a client redirect (meta refresh, document.loc...),
4814 // set the referrer appropriately.
4815 if (ds->isClientRedirect()) {
4816 params.referrer =
4817 Referrer(params.redirects[0], ds->request().referrerPolicy());
4818 } else {
4819 params.referrer =
4820 RenderViewImpl::GetReferrerFromRequest(frame, ds->request());
4821 }
4822
4813 if (!frame->parent()) { 4823 if (!frame->parent()) {
4814 // Top-level navigation. 4824 // Top-level navigation.
4815 4825
4816 // Reset the zoom limits in case a plugin had changed them previously. This 4826 // Reset the zoom limits in case a plugin had changed them previously. This
4817 // will also call us back which will cause us to send a message to 4827 // will also call us back which will cause us to send a message to
4818 // update WebContentsImpl. 4828 // update WebContentsImpl.
4819 render_view_->webview()->zoomLimitsChanged( 4829 render_view_->webview()->zoomLimitsChanged(
4820 ZoomFactorToZoomLevel(kMinimumZoomFactor), 4830 ZoomFactorToZoomLevel(kMinimumZoomFactor),
4821 ZoomFactorToZoomLevel(kMaximumZoomFactor)); 4831 ZoomFactorToZoomLevel(kMaximumZoomFactor));
4822 4832
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4855 // 3. You navigate to some non-frame site, say, google.com. 4865 // 3. You navigate to some non-frame site, say, google.com.
4856 // 4. You navigate back to the page from step 2. Since it was initially 4866 // 4. You navigate back to the page from step 2. Since it was initially
4857 // MANUAL_SUBFRAME, it will be that same transition type here. 4867 // MANUAL_SUBFRAME, it will be that same transition type here.
4858 // We don't want that, because any navigation that changes the toplevel 4868 // We don't want that, because any navigation that changes the toplevel
4859 // frame should be tracked as a toplevel navigation (this allows us to 4869 // frame should be tracked as a toplevel navigation (this allows us to
4860 // update the URL bar, etc). 4870 // update the URL bar, etc).
4861 params.transition = ui::PAGE_TRANSITION_LINK; 4871 params.transition = ui::PAGE_TRANSITION_LINK;
4862 } 4872 }
4863 4873
4864 // If the page contained a client redirect (meta refresh, document.loc...), 4874 // If the page contained a client redirect (meta refresh, document.loc...),
4865 // set the referrer and transition appropriately. 4875 // set the transition appropriately.
4866 if (ds->isClientRedirect()) { 4876 if (ds->isClientRedirect()) {
4867 params.referrer =
4868 Referrer(params.redirects[0], ds->request().referrerPolicy());
4869 params.transition = ui::PageTransitionFromInt( 4877 params.transition = ui::PageTransitionFromInt(
4870 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT); 4878 params.transition | ui::PAGE_TRANSITION_CLIENT_REDIRECT);
4871 } else {
4872 params.referrer = RenderViewImpl::GetReferrerFromRequest(
4873 frame, ds->request());
4874 } 4879 }
4875 4880
4876 // When using subframe navigation entries, method and post id have already 4881 // When using subframe navigation entries, method and post id have already
4877 // been set. 4882 // been set.
4878 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) { 4883 if (!SiteIsolationPolicy::UseSubframeNavigationEntries()) {
4879 params.method = request.httpMethod().latin1(); 4884 params.method = request.httpMethod().latin1();
4880 if (params.method == "POST") 4885 if (params.method == "POST")
4881 params.post_id = post_id; 4886 params.post_id = post_id;
4882 } 4887 }
4883 4888
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
6569 // event target. Potentially a Pepper plugin will receive the event. 6574 // event target. Potentially a Pepper plugin will receive the event.
6570 // In order to tell whether a plugin gets the last mouse event and which it 6575 // In order to tell whether a plugin gets the last mouse event and which it
6571 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6576 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6572 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6577 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6573 // |pepper_last_mouse_event_target_|. 6578 // |pepper_last_mouse_event_target_|.
6574 pepper_last_mouse_event_target_ = nullptr; 6579 pepper_last_mouse_event_target_ = nullptr;
6575 #endif 6580 #endif
6576 } 6581 }
6577 6582
6578 } // namespace content 6583 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698