Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2719)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: fixed test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5582fb55ff94d3324b0e821f7570388a09147b6f..59ec80196bf01c7bdc3b04b89ee25c51df53f072 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1629,6 +1629,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_BlinkFeatureUsageReport,
OnBlinkFeatureUsageReport)
IPC_MESSAGE_HANDLER(FrameMsg_MixedContentFound, OnMixedContentFound)
+ IPC_MESSAGE_HANDLER(FrameMsg_SetOverlayRoutingToken,
+ OnSetOverlayRoutingToken)
#if defined(OS_ANDROID)
IPC_MESSAGE_HANDLER(FrameMsg_ActivateNearestFindResult,
OnActivateNearestFindResult)
@@ -5923,6 +5925,28 @@ void RenderFrameImpl::OnFindMatchRects(int current_version) {
}
#endif
+void RenderFrameImpl::OnSetOverlayRoutingToken(
+ const base::UnguessableToken& token) {
+ overlay_routing_token_ = token;
+ for (const auto& cb : pending_routing_token_callbacks_)
+ cb.Run(overlay_routing_token_.value());
+ pending_routing_token_callbacks_.clear();
+}
+
+void RenderFrameImpl::RequestOverlayRoutingToken(
+ const media::RoutingTokenCallback& callback) {
+ if (overlay_routing_token_.has_value()) {
+ callback.Run(overlay_routing_token_.value());
+ return;
+ }
+
+ // Send a request to the host for the token. We'll notify |callback| when it
+ // arrives later.
+ Send(new FrameHostMsg_RequestOverlayRoutingToken(routing_id_));
+
+ pending_routing_token_callbacks_.push_back(callback);
+}
+
#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
#if defined(OS_MACOSX)
void RenderFrameImpl::OnSelectPopupMenuItem(int selected_index) {
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698