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

Unified Diff: content/renderer/render_frame_impl.h

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: fixed gn Created 3 years, 9 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
Index: content/renderer/render_frame_impl.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 1c59d7ab48694f6a309ce9a232682797e57534c9..a002b9c4e57068f61da25867dc497321b592087c 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -15,6 +15,7 @@
#include <string>
#include <vector>
+#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/id_map.h"
@@ -23,8 +24,10 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "base/optional.h"
#include "base/process/process_handle.h"
#include "base/single_thread_task_runner.h"
+#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "content/common/accessibility_mode.h"
#include "content/common/associated_interface_registry_impl.h"
@@ -47,6 +50,9 @@
#include "content/renderer/unique_name_helper.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_platform_file.h"
+#if defined(OS_ANDROID)
+#include "media/base/android/android_overlay.h"
+#endif
#include "media/blink/webmediaplayer_delegate.h"
#include "media/blink/webmediaplayer_params.h"
#include "media/mojo/interfaces/remoting.mojom.h"
@@ -764,6 +770,10 @@ class CONTENT_EXPORT RenderFrameImpl
FRIEND_TEST_ALL_PREFIXES(RenderAccessibilityImplTest,
AccessibilityMessagesQueueWhileSwappedOut);
FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest, ZoomLimit);
+ FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
+ TestOverlayRoutingTokenSendsLater);
+ FRIEND_TEST_ALL_PREFIXES(RenderFrameImplTest,
+ TestOverlayRoutingTokenSendsNow);
// A wrapper class used as the callback for JavaScript executed
// in an isolated world.
@@ -924,6 +934,7 @@ class CONTENT_EXPORT RenderFrameImpl
void OnActivateNearestFindResult(int request_id, float x, float y);
void OnGetNearestFindResult(int request_id, float x, float y);
void OnFindMatchRects(int current_version);
+ void OnSetOverlayRoutingToken(uint64_t high, uint64_t low);
#endif
#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
@@ -1119,6 +1130,15 @@ class CONTENT_EXPORT RenderFrameImpl
void InitializeBlameContext(RenderFrameImpl* parent_frame);
+#if defined(OS_ANDROID)
+ // Send |callback| our AndroidOverlay routing token when it arrives. We may
+ // call |callback| before returning.
+ void GetOverlayRoutingToken(const media::RoutingTokenCallback& callback);
+
+ // Ask the host to send our AndroidOverlay routing token to us.
+ void RequestOverlayRoutingTokenFromHost();
+#endif
+
// Stores the WebLocalFrame we are associated with. This is null from the
// constructor until BindToWebFrame is called, and it is null after
// frameDetached is called until destruction (which is asynchronous in the
@@ -1422,6 +1442,14 @@ class CONTENT_EXPORT RenderFrameImpl
// is used and released in didStartProvisionalLoad().
std::unique_ptr<PendingNavigationInfo> pending_navigation_info_;
+#if defined(OS_ANDROID)
+ // AndroidOverlay routing token from the browser, if we have one yet.
+ base::Optional<base::UnguessableToken> overlay_routing_token_;
+
+ // Callbacks that we should call when we get a routing token.
+ std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_;
+#endif
+
base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);

Powered by Google App Engine
This is Rietveld 408576698