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