Index: chrome/browser/android/tab_android.h |
diff --git a/chrome/browser/android/tab_android.h b/chrome/browser/android/tab_android.h |
index 40390ee71210538220fd735af311cc3ec0e1f311..4b3b58ecffb5511033cb1263159c96d8ffb5c295 100644 |
--- a/chrome/browser/android/tab_android.h |
+++ b/chrome/browser/android/tab_android.h |
@@ -14,6 +14,7 @@ |
#include "base/android/scoped_java_ref.h" |
#include "base/callback_forward.h" |
#include "base/macros.h" |
+#include "base/memory/weak_ptr.h" |
#include "base/strings/string16.h" |
#include "chrome/browser/sync/glue/synced_tab_delegate_android.h" |
#include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
@@ -23,6 +24,9 @@ |
#include "components/toolbar/toolbar_model.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
+#include "content/public/browser/web_contents_observer.h" |
+#include "services/service_manager/public/cpp/binder_registry.h" |
+#include "third_party/WebKit/public/platform/media_in_product_help.mojom.h" |
class GURL; |
class Profile; |
@@ -51,7 +55,8 @@ class PrerenderManager; |
class TabAndroid : public CoreTabHelperDelegate, |
public content::NotificationObserver, |
- public favicon::FaviconDriverObserver { |
+ public favicon::FaviconDriverObserver, |
+ public content::WebContentsObserver { |
public: |
// A Java counterpart will be generated for this enum. |
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser |
@@ -246,6 +251,10 @@ class TabAndroid : public CoreTabHelperDelegate, |
const base::android::JavaParamRef<jobject>& obj, |
jboolean enabled); |
+ void DownloadMediaInProductHelpDismissed( |
+ JNIEnv* env, |
+ const base::android::JavaParamRef<jobject>& obj); |
+ |
bool ShouldEnableEmbeddedMediaExperience() const; |
scoped_refptr<content::DevToolsAgentHost> GetDevToolsAgentHost(); |
@@ -258,9 +267,24 @@ class TabAndroid : public CoreTabHelperDelegate, |
// Register the Tab's native methods through JNI. |
static bool RegisterTabAndroid(JNIEnv* env); |
+ // content::WebContents implementation. |
+ void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; |
+ void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; |
+ |
private: |
+ class MediaInProductHelp; |
+ |
prerender::PrerenderManager* GetPrerenderManager() const; |
+ // methods used by MediaInProductHelp. |
+ void CreateInProductHelpService( |
+ content::RenderFrameHost* render_frame_host, |
+ const service_manager::BindSourceInfo& source_info, |
+ blink::mojom::MediaInProductHelpRequest request); |
+ void ShowMediaDownloadInProductHelp(const gfx::Rect& rect_in_frame); |
+ void DismissMediaDownloadInProductHelp(); |
+ void OnMediaInProductHelpConnectionError(); |
+ |
JavaObjectWeakGlobalRef weak_java_tab_; |
// The identifier used by session restore for this tab. |
@@ -283,6 +307,10 @@ class TabAndroid : public CoreTabHelperDelegate, |
std::string webapp_manifest_scope_; |
bool embedded_media_experience_enabled_; |
+ std::unique_ptr<MediaInProductHelp> media_in_product_help_; |
+ |
+ base::WeakPtrFactory<TabAndroid> weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
}; |