Chromium Code Reviews| 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> | |
|
jam
2017/01/11 16:38:06
no need, it's in the header by definition
carlosk
2017/01/11 22:15:03
Done.
| |
| 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_MixedContentFound, | |
| 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6778 // event target. Potentially a Pepper plugin will receive the event. | 6800 // event target. Potentially a Pepper plugin will receive the event. |
| 6779 // 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 |
| 6780 // 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 |
| 6781 // 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 |
| 6782 // |pepper_last_mouse_event_target_|. | 6804 // |pepper_last_mouse_event_target_|. |
| 6783 pepper_last_mouse_event_target_ = nullptr; | 6805 pepper_last_mouse_event_target_ = nullptr; |
| 6784 #endif | 6806 #endif |
| 6785 } | 6807 } |
| 6786 | 6808 |
| 6787 } // namespace content | 6809 } // namespace content |
| OLD | NEW |