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

Unified Diff: chrome/browser/android/tab_android.h

Issue 2943983003: chrome/blink: Add functionality for in-product help for media elements. (Closed)
Patch Set: .. Created 3 years, 4 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 | « chrome/browser/android/DEPS ('k') | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/tab_android.h
diff --git a/chrome/browser/android/tab_android.h b/chrome/browser/android/tab_android.h
index b9e4a874439e082b0a4e639be9bea24820ac3675..91077766da979b92df5ba55b5b3d86a85f0f1f5d 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_download_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
@@ -255,6 +260,10 @@ class TabAndroid : public CoreTabHelperDelegate,
const base::android::JavaParamRef<jobject>& obj,
jboolean enabled);
+ void MediaDownloadInProductHelpDismissed(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
bool ShouldEnableEmbeddedMediaExperience() const;
scoped_refptr<content::DevToolsAgentHost> GetDevToolsAgentHost();
@@ -264,9 +273,29 @@ class TabAndroid : public CoreTabHelperDelegate,
void AttachDetachedTab(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
+ // Register the Tab's native methods through JNI.
+ static bool RegisterTabAndroid(JNIEnv* env);
+
+ // content::WebContents implementation.
+ void OnInterfaceRequestFromFrame(
+ content::RenderFrameHost* render_frame_host,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle* interface_pipe) override;
+ void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
+
private:
+ class MediaDownloadInProductHelp;
+
prerender::PrerenderManager* GetPrerenderManager() const;
+ // methods used by MediaDownloadInProductHelp.
+ void CreateInProductHelpService(
+ blink::mojom::MediaDownloadInProductHelpRequest request,
+ content::RenderFrameHost* render_frame_host);
+ void ShowMediaDownloadInProductHelp(const gfx::Rect& rect_in_frame);
+ void DismissMediaDownloadInProductHelp();
+ void OnMediaDownloadInProductHelpConnectionError();
+
JavaObjectWeakGlobalRef weak_java_tab_;
// The identifier used by session restore for this tab.
@@ -289,6 +318,13 @@ class TabAndroid : public CoreTabHelperDelegate,
std::string webapp_manifest_scope_;
bool embedded_media_experience_enabled_;
+ std::unique_ptr<MediaDownloadInProductHelp> media_in_product_help_;
+
+ service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>
+ frame_interfaces_;
+
+ base::WeakPtrFactory<TabAndroid> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(TabAndroid);
};
« no previous file with comments | « chrome/browser/android/DEPS ('k') | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698