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 4841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4852 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) { | 4852 void RenderFrameImpl::FocusedNodeChangedForAccessibility(const WebNode& node) { |
4853 if (render_accessibility()) | 4853 if (render_accessibility()) |
4854 render_accessibility()->AccessibilityFocusedNodeChanged(node); | 4854 render_accessibility()->AccessibilityFocusedNodeChanged(node); |
4855 } | 4855 } |
4856 | 4856 |
4857 // PlzNavigate | 4857 // PlzNavigate |
4858 void RenderFrameImpl::OnCommitNavigation( | 4858 void RenderFrameImpl::OnCommitNavigation( |
4859 const ResourceResponseHead& response, | 4859 const ResourceResponseHead& response, |
4860 const GURL& stream_url, | 4860 const GURL& stream_url, |
4861 const CommonNavigationParams& common_params, | 4861 const CommonNavigationParams& common_params, |
4862 const RequestNavigationParams& request_params) { | 4862 const RequestNavigationParams& request_params, |
| 4863 bool user_gesture) { |
4863 CHECK(IsBrowserSideNavigationEnabled()); | 4864 CHECK(IsBrowserSideNavigationEnabled()); |
4864 // 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 |
4865 // provide it with the response to the request. | 4866 // provide it with the response to the request. |
4866 std::unique_ptr<StreamOverrideParameters> stream_override( | 4867 std::unique_ptr<StreamOverrideParameters> stream_override( |
4867 new StreamOverrideParameters()); | 4868 new StreamOverrideParameters()); |
4868 stream_override->stream_url = stream_url; | 4869 stream_override->stream_url = stream_url; |
4869 stream_override->response = response; | 4870 stream_override->response = response; |
4870 | 4871 |
| 4872 // 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. |
| 4874 std::unique_ptr<blink::WebScopedUserGesture> gesture( |
| 4875 user_gesture ? new blink::WebScopedUserGesture : nullptr); |
| 4876 |
4871 NavigateInternal(common_params, StartNavigationParams(), request_params, | 4877 NavigateInternal(common_params, StartNavigationParams(), request_params, |
4872 std::move(stream_override)); | 4878 std::move(stream_override)); |
4873 } | 4879 } |
4874 | 4880 |
4875 // PlzNavigate | 4881 // PlzNavigate |
4876 void RenderFrameImpl::OnFailedNavigation( | 4882 void RenderFrameImpl::OnFailedNavigation( |
4877 const CommonNavigationParams& common_params, | 4883 const CommonNavigationParams& common_params, |
4878 const RequestNavigationParams& request_params, | 4884 const RequestNavigationParams& request_params, |
4879 bool has_stale_copy_in_cache, | 4885 bool has_stale_copy_in_cache, |
4880 int error_code) { | 4886 int error_code) { |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6410 // event target. Potentially a Pepper plugin will receive the event. | 6416 // event target. Potentially a Pepper plugin will receive the event. |
6411 // In order to tell whether a plugin gets the last mouse event and which it | 6417 // In order to tell whether a plugin gets the last mouse event and which it |
6412 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6418 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6413 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6419 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6414 // |pepper_last_mouse_event_target_|. | 6420 // |pepper_last_mouse_event_target_|. |
6415 pepper_last_mouse_event_target_ = nullptr; | 6421 pepper_last_mouse_event_target_ = nullptr; |
6416 #endif | 6422 #endif |
6417 } | 6423 } |
6418 | 6424 |
6419 } // namespace content | 6425 } // namespace content |
OLD | NEW |