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 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) | 1606 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) |
1607 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, | 1607 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, |
1608 OnBlinkFeatureUsageReport) | 1608 OnBlinkFeatureUsageReport) |
1609 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) | 1609 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) |
1610 #if defined(OS_ANDROID) | 1610 #if defined(OS_ANDROID) |
1611 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, | 1611 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, |
1612 OnActivateNearestFindResult) | 1612 OnActivateNearestFindResult) |
1613 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, | 1613 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, |
1614 OnGetNearestFindResult) | 1614 OnGetNearestFindResult) |
1615 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) | 1615 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) |
| 1616 IPC_MESSAGE_HANDLER(FrameMsg_SetOverlayRoutingToken, |
| 1617 OnSetOverlayRoutingToken) |
1616 #endif | 1618 #endif |
1617 | 1619 |
1618 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 1620 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
1619 #if defined(OS_MACOSX) | 1621 #if defined(OS_MACOSX) |
1620 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1622 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
1621 #else | 1623 #else |
1622 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1624 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
1623 #endif | 1625 #endif |
1624 #endif | 1626 #endif |
1625 | 1627 |
(...skipping 4214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5840 frame_->findMatchRects(web_match_rects); | 5842 frame_->findMatchRects(web_match_rects); |
5841 match_rects.reserve(web_match_rects.size()); | 5843 match_rects.reserve(web_match_rects.size()); |
5842 for (size_t i = 0; i < web_match_rects.size(); ++i) | 5844 for (size_t i = 0; i < web_match_rects.size(); ++i) |
5843 match_rects.push_back(gfx::RectF(web_match_rects[i])); | 5845 match_rects.push_back(gfx::RectF(web_match_rects[i])); |
5844 } | 5846 } |
5845 | 5847 |
5846 gfx::RectF active_rect = frame_->activeFindMatchRect(); | 5848 gfx::RectF active_rect = frame_->activeFindMatchRect(); |
5847 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, | 5849 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, |
5848 match_rects, active_rect)); | 5850 match_rects, active_rect)); |
5849 } | 5851 } |
| 5852 |
| 5853 void RenderFrameImpl::OnSetOverlayRoutingToken(uint64_t high, uint64_t low) { |
| 5854 overlay_routing_token_ = base::UnguessableToken::Deserialize(high, low); |
| 5855 for (const auto& cb : pending_routing_token_callbacks_) |
| 5856 cb.Run(overlay_routing_token_.value()); |
| 5857 pending_routing_token_callbacks_.clear(); |
| 5858 } |
| 5859 |
| 5860 void RenderFrameImpl::GetOverlayRoutingToken( |
| 5861 const media::RoutingTokenCallback& callback) { |
| 5862 if (overlay_routing_token_.has_value()) { |
| 5863 callback.Run(overlay_routing_token_.value()); |
| 5864 return; |
| 5865 } |
| 5866 |
| 5867 // Send a request to the host for the token. We'll notify |callback| when it |
| 5868 // arrives later. |
| 5869 Send(new FrameHostMsg_RequestOverlayRoutingToken(routing_id_)); |
| 5870 |
| 5871 pending_routing_token_callbacks_.push_back(callback); |
| 5872 } |
5850 #endif | 5873 #endif |
5851 | 5874 |
5852 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 5875 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
5853 #if defined(OS_MACOSX) | 5876 #if defined(OS_MACOSX) |
5854 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { | 5877 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { |
5855 if (external_popup_menu_ == NULL) | 5878 if (external_popup_menu_ == NULL) |
5856 return; | 5879 return; |
5857 external_popup_menu_->DidSelectItem(selected_index); | 5880 external_popup_menu_->DidSelectItem(selected_index); |
5858 external_popup_menu_.reset(); | 5881 external_popup_menu_.reset(); |
5859 } | 5882 } |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6969 policy(info.defaultPolicy), | 6992 policy(info.defaultPolicy), |
6970 replaces_current_history_item(info.replacesCurrentHistoryItem), | 6993 replaces_current_history_item(info.replacesCurrentHistoryItem), |
6971 history_navigation_in_new_child_frame( | 6994 history_navigation_in_new_child_frame( |
6972 info.isHistoryNavigationInNewChildFrame), | 6995 info.isHistoryNavigationInNewChildFrame), |
6973 client_redirect(info.isClientRedirect), | 6996 client_redirect(info.isClientRedirect), |
6974 cache_disabled(info.isCacheDisabled), | 6997 cache_disabled(info.isCacheDisabled), |
6975 form(info.form), | 6998 form(info.form), |
6976 source_location(info.sourceLocation) {} | 6999 source_location(info.sourceLocation) {} |
6977 | 7000 |
6978 } // namespace content | 7001 } // namespace content |
OLD | NEW |