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 4850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4861 const GURL& stream_url, | 4861 const GURL& stream_url, |
4862 const CommonNavigationParams& common_params, | 4862 const CommonNavigationParams& common_params, |
4863 const RequestNavigationParams& request_params) { | 4863 const RequestNavigationParams& request_params) { |
4864 CHECK(IsBrowserSideNavigationEnabled()); | 4864 CHECK(IsBrowserSideNavigationEnabled()); |
4865 // This will override the url requested by the WebURLLoader, as well as | 4865 // This will override the url requested by the WebURLLoader, as well as |
4866 // provide it with the response to the request. | 4866 // provide it with the response to the request. |
4867 std::unique_ptr<StreamOverrideParameters> stream_override( | 4867 std::unique_ptr<StreamOverrideParameters> stream_override( |
4868 new StreamOverrideParameters()); | 4868 new StreamOverrideParameters()); |
4869 stream_override->stream_url = stream_url; | 4869 stream_override->stream_url = stream_url; |
4870 stream_override->response = response; | 4870 stream_override->response = response; |
| 4871 stream_override->redirects = request_params.redirects; |
| 4872 stream_override->redirect_responses = request_params.redirect_response; |
4871 | 4873 |
4872 // If the request was initiated in the context of a user gesture then make | 4874 // If the request was initiated in the context of a user gesture then make |
4873 // sure that the navigation also executes in the context of a user gesture. | 4875 // sure that the navigation also executes in the context of a user gesture. |
4874 std::unique_ptr<blink::WebScopedUserGesture> gesture( | 4876 std::unique_ptr<blink::WebScopedUserGesture> gesture( |
4875 request_params.has_user_gesture ? new blink::WebScopedUserGesture | 4877 request_params.has_user_gesture ? new blink::WebScopedUserGesture |
4876 : nullptr); | 4878 : nullptr); |
4877 | 4879 |
4878 NavigateInternal(common_params, StartNavigationParams(), request_params, | 4880 NavigateInternal(common_params, StartNavigationParams(), request_params, |
4879 std::move(stream_override)); | 4881 std::move(stream_override)); |
4880 } | 4882 } |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5538 request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data)); | 5540 request.setHTTPBody(GetWebHTTPBodyForRequestBody(common_params.post_data)); |
5539 | 5541 |
5540 // Used to determine whether this frame is actually loading a request as part | 5542 // Used to determine whether this frame is actually loading a request as part |
5541 // of a history navigation. | 5543 // of a history navigation. |
5542 bool has_history_navigation_in_frame = false; | 5544 bool has_history_navigation_in_frame = false; |
5543 | 5545 |
5544 #if defined(OS_ANDROID) | 5546 #if defined(OS_ANDROID) |
5545 request.setHasUserGesture(request_params.has_user_gesture); | 5547 request.setHasUserGesture(request_params.has_user_gesture); |
5546 #endif | 5548 #endif |
5547 | 5549 |
5548 // PlzNavigate: Make sure that Blink's loader will not try to use browser side | 5550 if (browser_side_navigation) { |
5549 // navigation for this request (since it already went to the browser). | 5551 // PlzNavigate: Make sure that Blink's loader will not try to use browser |
5550 if (browser_side_navigation) | 5552 // side navigation for this request (since it already went to the browser). |
5551 request.setCheckForBrowserSideNavigation(false); | 5553 request.setCheckForBrowserSideNavigation(false); |
5552 | 5554 |
| 5555 request.setNavigationStartTime( |
| 5556 ConvertToBlinkTime(common_params.navigation_start)); |
| 5557 } |
| 5558 |
5553 // If we are reloading, then use the history state of the current frame. | 5559 // If we are reloading, then use the history state of the current frame. |
5554 // Otherwise, if we have history state, then we need to navigate to it, which | 5560 // Otherwise, if we have history state, then we need to navigate to it, which |
5555 // corresponds to a back/forward navigation event. Update the parameters | 5561 // corresponds to a back/forward navigation event. Update the parameters |
5556 // depending on the navigation type. | 5562 // depending on the navigation type. |
5557 if (is_reload) { | 5563 if (is_reload) { |
5558 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type); | 5564 load_type = ReloadFrameLoadTypeFor(common_params.navigation_type); |
5559 | 5565 |
5560 if (!browser_side_navigation) { | 5566 if (!browser_side_navigation) { |
5561 const GURL override_url = | 5567 const GURL override_url = |
5562 (common_params.navigation_type == | 5568 (common_params.navigation_type == |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6430 // event target. Potentially a Pepper plugin will receive the event. | 6436 // event target. Potentially a Pepper plugin will receive the event. |
6431 // In order to tell whether a plugin gets the last mouse event and which it | 6437 // In order to tell whether a plugin gets the last mouse event and which it |
6432 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6438 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6433 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6439 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6434 // |pepper_last_mouse_event_target_|. | 6440 // |pepper_last_mouse_event_target_|. |
6435 pepper_last_mouse_event_target_ = nullptr; | 6441 pepper_last_mouse_event_target_ = nullptr; |
6436 #endif | 6442 #endif |
6437 } | 6443 } |
6438 | 6444 |
6439 } // namespace content | 6445 } // namespace content |
OLD | NEW |