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 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) | 1622 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) |
1623 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) | 1623 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
1624 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1624 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
1625 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, | 1625 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, |
1626 OnSuppressFurtherDialogs) | 1626 OnSuppressFurtherDialogs) |
1627 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) | 1627 IPC_MESSAGE_HANDLER(FrameMsg_RunFileChooserResponse, OnFileChooserResponse) |
1628 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) | 1628 IPC_MESSAGE_HANDLER(FrameMsg_ClearFocusedElement, OnClearFocusedElement) |
1629 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, | 1629 IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport, |
1630 OnBlinkFeatureUsageReport) | 1630 OnBlinkFeatureUsageReport) |
1631 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) | 1631 IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound) |
| 1632 IPC_MESSAGE_HANDLER(FrameMsg_SetOverlayRoutingToken, |
| 1633 OnSetOverlayRoutingToken) |
1632 #if defined(OS_ANDROID) | 1634 #if defined(OS_ANDROID) |
1633 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, | 1635 IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult, |
1634 OnActivateNearestFindResult) | 1636 OnActivateNearestFindResult) |
1635 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, | 1637 IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult, |
1636 OnGetNearestFindResult) | 1638 OnGetNearestFindResult) |
1637 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) | 1639 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) |
1638 #endif | 1640 #endif |
1639 | 1641 |
1640 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 1642 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
1641 #if defined(OS_MACOSX) | 1643 #if defined(OS_MACOSX) |
(...skipping 4274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5916 for (size_t i = 0; i < web_match_rects.size(); ++i) | 5918 for (size_t i = 0; i < web_match_rects.size(); ++i) |
5917 match_rects.push_back(gfx::RectF(web_match_rects[i])); | 5919 match_rects.push_back(gfx::RectF(web_match_rects[i])); |
5918 } | 5920 } |
5919 | 5921 |
5920 gfx::RectF active_rect = frame_->ActiveFindMatchRect(); | 5922 gfx::RectF active_rect = frame_->ActiveFindMatchRect(); |
5921 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, | 5923 Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version, |
5922 match_rects, active_rect)); | 5924 match_rects, active_rect)); |
5923 } | 5925 } |
5924 #endif | 5926 #endif |
5925 | 5927 |
| 5928 void RenderFrameImpl::OnSetOverlayRoutingToken( |
| 5929 const base::UnguessableToken& token) { |
| 5930 overlay_routing_token_ = token; |
| 5931 for (const auto& cb : pending_routing_token_callbacks_) |
| 5932 cb.Run(overlay_routing_token_.value()); |
| 5933 pending_routing_token_callbacks_.clear(); |
| 5934 } |
| 5935 |
| 5936 void RenderFrameImpl::RequestOverlayRoutingToken( |
| 5937 const media::RoutingTokenCallback& callback) { |
| 5938 if (overlay_routing_token_.has_value()) { |
| 5939 callback.Run(overlay_routing_token_.value()); |
| 5940 return; |
| 5941 } |
| 5942 |
| 5943 // Send a request to the host for the token. We'll notify |callback| when it |
| 5944 // arrives later. |
| 5945 Send(new FrameHostMsg_RequestOverlayRoutingToken(routing_id_)); |
| 5946 |
| 5947 pending_routing_token_callbacks_.push_back(callback); |
| 5948 } |
| 5949 |
5926 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 5950 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
5927 #if defined(OS_MACOSX) | 5951 #if defined(OS_MACOSX) |
5928 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { | 5952 void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) { |
5929 if (external_popup_menu_ == NULL) | 5953 if (external_popup_menu_ == NULL) |
5930 return; | 5954 return; |
5931 external_popup_menu_->DidSelectItem(selected_index); | 5955 external_popup_menu_->DidSelectItem(selected_index); |
5932 external_popup_menu_.reset(); | 5956 external_popup_menu_.reset(); |
5933 } | 5957 } |
5934 #else | 5958 #else |
5935 void RenderFrameImpl::OnSelectPopupMenuItems( | 5959 void RenderFrameImpl::OnSelectPopupMenuItems( |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7044 policy(info.default_policy), | 7068 policy(info.default_policy), |
7045 replaces_current_history_item(info.replaces_current_history_item), | 7069 replaces_current_history_item(info.replaces_current_history_item), |
7046 history_navigation_in_new_child_frame( | 7070 history_navigation_in_new_child_frame( |
7047 info.is_history_navigation_in_new_child_frame), | 7071 info.is_history_navigation_in_new_child_frame), |
7048 client_redirect(info.is_client_redirect), | 7072 client_redirect(info.is_client_redirect), |
7049 cache_disabled(info.is_cache_disabled), | 7073 cache_disabled(info.is_cache_disabled), |
7050 form(info.form), | 7074 form(info.form), |
7051 source_location(info.source_location) {} | 7075 source_location(info.source_location) {} |
7052 | 7076 |
7053 } // namespace content | 7077 } // namespace content |
OLD | NEW |