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 <set> |
8 #include <string> | 9 #include <string> |
9 #include <utility> | 10 #include <utility> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/auto_reset.h" | 13 #include "base/auto_reset.h" |
13 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
15 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
16 #include "base/debug/asan_invalid_access.h" | 17 #include "base/debug/asan_invalid_access.h" |
17 #include "base/debug/crash_logging.h" | 18 #include "base/debug/crash_logging.h" |
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) | 1569 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) |
1569 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) | 1570 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) |
1570 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) | 1571 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
1571 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1572 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
1572 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, | 1573 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, |
1573 OnSuppressFurtherDialogs) | 1574 OnSuppressFurtherDialogs) |
1574 IPC_MESSAGE_HANDLER(FrameMsg_SetHasReceivedUserGesture, | 1575 IPC_MESSAGE_HANDLER(FrameMsg_SetHasReceivedUserGesture, |
1575 OnSetHasReceivedUserGesture) | 1576 OnSetHasReceivedUserGesture) |
1576 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) | 1577 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) |
1577 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) | 1578 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) |
| 1579 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, |
| 1580 OnBlinkFeatureUsageReport) |
| 1581 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFoundByTheBrowser, |
| 1582 OnMixedContentFoundByTheBrowser) |
1578 #if defined(OS_ANDROID) | 1583 #if defined(OS_ANDROID) |
1579 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, | 1584 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, |
1580 OnActivateNearestFindResult) | 1585 OnActivateNearestFindResult) |
1581 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, | 1586 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, |
1582 OnGetNearestFindResult) | 1587 OnGetNearestFindResult) |
1583 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) | 1588 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) |
1584 #endif | 1589 #endif |
1585 | 1590 |
1586 #if defined(USE_EXTERNAL_POPUP_MENU) | 1591 #if defined(USE_EXTERNAL_POPUP_MENU) |
1587 #if defined(OS_MACOSX) | 1592 #if defined(OS_MACOSX) |
(...skipping 4049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5637 } | 5642 } |
5638 } | 5643 } |
5639 | 5644 |
5640 void RenderFrameImpl::OnClearFocusedElement() { | 5645 void RenderFrameImpl::OnClearFocusedElement() { |
5641 // TODO(ekaramad): Should we add a method to WebLocalFrame instead and avoid | 5646 // TODO(ekaramad): Should we add a method to WebLocalFrame instead and avoid |
5642 // calling this on the WebView? | 5647 // calling this on the WebView? |
5643 if (auto* webview = render_view_->GetWebView()) | 5648 if (auto* webview = render_view_->GetWebView()) |
5644 webview->clearFocusedElement(); | 5649 webview->clearFocusedElement(); |
5645 } | 5650 } |
5646 | 5651 |
| 5652 void RenderFrameImpl::OnBlinkFeatureUsageReport(const std::set<int>& features) { |
| 5653 frame_->blinkFeatureUsageReport(features); |
| 5654 } |
| 5655 |
| 5656 void RenderFrameImpl::OnMixedContentFoundByTheBrowser( |
| 5657 const GURL& main_resource_url, |
| 5658 const GURL& mixed_content_url, |
| 5659 RequestContextType request_context_type, |
| 5660 bool was_allowed, |
| 5661 bool had_redirect) { |
| 5662 auto request_context = |
| 5663 static_cast<blink::WebURLRequest::RequestContext>(request_context_type); |
| 5664 frame_->mixedContentFoundByTheBrowser(main_resource_url, mixed_content_url, |
| 5665 request_context, was_allowed, |
| 5666 had_redirect); |
| 5667 } |
| 5668 |
5647 #if defined(OS_ANDROID) | 5669 #if defined(OS_ANDROID) |
5648 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, | 5670 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, |
5649 float x, | 5671 float x, |
5650 float y) { | 5672 float y) { |
5651 WebRect selection_rect; | 5673 WebRect selection_rect; |
5652 int ordinal = | 5674 int ordinal = |
5653 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); | 5675 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); |
5654 if (ordinal == -1) { | 5676 if (ordinal == -1) { |
5655 // Something went wrong, so send a no-op reply (force the frame to report | 5677 // Something went wrong, so send a no-op reply (force the frame to report |
5656 // the current match count) in case the host is waiting for a response due | 5678 // the current match count) in case the host is waiting for a response due |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6202 base::Optional<url::Origin> initiator_origin = | 6224 base::Optional<url::Origin> initiator_origin = |
6203 info.urlRequest.requestorOrigin().isNull() | 6225 info.urlRequest.requestorOrigin().isNull() |
6204 ? base::Optional<url::Origin>() | 6226 ? base::Optional<url::Origin>() |
6205 : base::Optional<url::Origin>(info.urlRequest.requestorOrigin()); | 6227 : base::Optional<url::Origin>(info.urlRequest.requestorOrigin()); |
6206 BeginNavigationParams begin_navigation_params( | 6228 BeginNavigationParams begin_navigation_params( |
6207 GetWebURLRequestHeaders(info.urlRequest), | 6229 GetWebURLRequestHeaders(info.urlRequest), |
6208 GetLoadFlagsForWebURLRequest(info.urlRequest), | 6230 GetLoadFlagsForWebURLRequest(info.urlRequest), |
6209 info.urlRequest.hasUserGesture(), | 6231 info.urlRequest.hasUserGesture(), |
6210 info.urlRequest.skipServiceWorker() != | 6232 info.urlRequest.skipServiceWorker() != |
6211 blink::WebURLRequest::SkipServiceWorker::None, | 6233 blink::WebURLRequest::SkipServiceWorker::None, |
6212 GetRequestContextTypeForWebURLRequest(info.urlRequest), initiator_origin); | 6234 GetRequestContextTypeForWebURLRequest(info.urlRequest), |
| 6235 GetMixedContentContextTypeForWebURLRequest(info.urlRequest), |
| 6236 initiator_origin); |
6213 | 6237 |
6214 if (!info.form.isNull()) { | 6238 if (!info.form.isNull()) { |
6215 WebSearchableFormData web_searchable_form_data(info.form); | 6239 WebSearchableFormData web_searchable_form_data(info.form); |
6216 begin_navigation_params.searchable_form_url = | 6240 begin_navigation_params.searchable_form_url = |
6217 web_searchable_form_data.url(); | 6241 web_searchable_form_data.url(); |
6218 begin_navigation_params.searchable_form_encoding = | 6242 begin_navigation_params.searchable_form_encoding = |
6219 web_searchable_form_data.encoding().utf8(); | 6243 web_searchable_form_data.encoding().utf8(); |
6220 } | 6244 } |
6221 | 6245 |
6222 Send(new FrameHostMsg_BeginNavigation( | 6246 Send(new FrameHostMsg_BeginNavigation( |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6776 // event target. Potentially a Pepper plugin will receive the event. | 6800 // event target. Potentially a Pepper plugin will receive the event. |
6777 // In order to tell whether a plugin gets the last mouse event and which it | 6801 // In order to tell whether a plugin gets the last mouse event and which it |
6778 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6802 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6779 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6803 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6780 // |pepper_last_mouse_event_target_|. | 6804 // |pepper_last_mouse_event_target_|. |
6781 pepper_last_mouse_event_target_ = nullptr; | 6805 pepper_last_mouse_event_target_ = nullptr; |
6782 #endif | 6806 #endif |
6783 } | 6807 } |
6784 | 6808 |
6785 } // namespace content | 6809 } // namespace content |
OLD | NEW |