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

Unified Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: cl feedback, fixed browsertests 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
Index: content/browser/frame_host/render_frame_host_impl.h
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h
index 482e2e3748373d9b0e2880eaa54f9e34c0adf00b..7e553fff7f3d3623b328435a573295edd59b1d29 100644
--- a/content/browser/frame_host/render_frame_host_impl.h
+++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -19,6 +19,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/supports_user_data.h"
#include "base/time/time.h"
@@ -134,6 +135,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
static RenderFrameHostImpl* FromID(int process_id, int routing_id);
static RenderFrameHostImpl* FromAXTreeID(
ui::AXTreeIDRegistry::AXTreeID ax_tree_id);
+#if defined(OS_ANDROID)
+ static RenderFrameHostImpl* FromOverlayRoutingToken(
+ const base::UnguessableToken& token);
+#endif
~RenderFrameHostImpl() override;
@@ -634,6 +639,14 @@ class CONTENT_EXPORT RenderFrameHostImpl
#if defined(OS_ANDROID)
base::android::ScopedJavaLocalRef<jobject> GetJavaRenderFrameHost();
service_manager::InterfaceProvider* GetJavaInterfaces() override;
+
+ // Returns an unguessable token for this RFHI. This provides a temporary way
+ // to identify a RenderFrameHost that's compatible with IPC. Else, one needs
+ // to send pid + RoutingID, but one cannot send pid. One can get it from the
+ // channel, but this makes it much harder to get wrong.
+ // Once media switches to mojo, we should be able to remove this in favor of
+ // sending a mojo overlay factory.
+ const base::UnguessableToken& GetOverlayRoutingToken();
#endif
protected:
@@ -789,6 +802,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
#endif
#if defined(OS_ANDROID)
void OnNavigationHandledByEmbedder();
+
+ // Called when the frame would like an overlay routing token. This will
+ // create one if needed. Either way, it will send it to the frame.
+ void OnRequestOverlayRoutingToken();
#endif
void OnShowCreatedWindow(int pending_widget_routing_id,
WindowOpenDisposition disposition,
@@ -1171,6 +1188,10 @@ class CONTENT_EXPORT RenderFrameHostImpl
#if defined(OS_ANDROID)
std::unique_ptr<service_manager::InterfaceProvider> java_interfaces_;
+
+ // IPC-friendly token that represents this host for AndroidOverlays, if we
+ // have created one yet.
+ base::Optional<base::UnguessableToken> overlay_routing_token_;
#endif
// NOTE: This must be the last member.

Powered by Google App Engine
This is Rietveld 408576698