Chromium Code Reviews| Index: content/renderer/render_frame_impl.h |
| diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h |
| index 11effea35eea45401d007aec0729f46bbc8d1dff..8a8d7be0633d2fc1619ece7ee6355122964996c8 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/routing_token_callback.h" |
|
boliu
2017/04/04 23:53:21
nit: platform-specific includes after the cross-pl
liberato (no reviews please)
2017/04/05 15:13:30
Done.
|
| +#endif |
| #include "media/blink/webmediaplayer_delegate.h" |
| #include "media/blink/webmediaplayer_params.h" |
| #include "media/mojo/interfaces/remoting.mojom.h" |
| @@ -763,6 +769,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. |
| @@ -923,6 +933,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(const base::UnguessableToken& token); |
| #endif |
| #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
| @@ -1118,6 +1129,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 |
| @@ -1421,6 +1441,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); |