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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 5 #ifndef CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/android/jni_weak_ref.h" 13 #include "base/android/jni_weak_ref.h"
14 #include "base/android/scoped_java_ref.h" 14 #include "base/android/scoped_java_ref.h"
15 #include "base/callback_forward.h" 15 #include "base/callback_forward.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
18 #include "chrome/browser/android/media_iph_manager.h"
18 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" 19 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h"
19 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 20 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
20 #include "components/favicon/core/favicon_driver_observer.h" 21 #include "components/favicon/core/favicon_driver_observer.h"
21 #include "components/infobars/core/infobar_manager.h" 22 #include "components/infobars/core/infobar_manager.h"
22 #include "components/sessions/core/session_id.h" 23 #include "components/sessions/core/session_id.h"
23 #include "components/toolbar/toolbar_model.h" 24 #include "components/toolbar/toolbar_model.h"
24 #include "content/public/browser/notification_observer.h" 25 #include "content/public/browser/notification_observer.h"
25 #include "content/public/browser/notification_registrar.h" 26 #include "content/public/browser/notification_registrar.h"
26 27
27 class GURL; 28 class GURL;
(...skipping 16 matching lines...) Expand all
44 class DevToolsAgentHost; 45 class DevToolsAgentHost;
45 class WebContents; 46 class WebContents;
46 } 47 }
47 48
48 namespace prerender { 49 namespace prerender {
49 class PrerenderManager; 50 class PrerenderManager;
50 } 51 }
51 52
52 class TabAndroid : public CoreTabHelperDelegate, 53 class TabAndroid : public CoreTabHelperDelegate,
53 public content::NotificationObserver, 54 public content::NotificationObserver,
54 public favicon::FaviconDriverObserver { 55 public favicon::FaviconDriverObserver,
56 public MediaIPHManagerClient {
55 public: 57 public:
56 // A Java counterpart will be generated for this enum. 58 // A Java counterpart will be generated for this enum.
57 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser 59 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser
58 enum TabLoadStatus { 60 enum TabLoadStatus {
59 PAGE_LOAD_FAILED = 0, 61 PAGE_LOAD_FAILED = 0,
60 DEFAULT_PAGE_LOAD = 1, 62 DEFAULT_PAGE_LOAD = 1,
61 PARTIAL_PRERENDERED_PAGE_LOAD = 2, 63 PARTIAL_PRERENDERED_PAGE_LOAD = 2,
62 FULL_PRERENDERED_PAGE_LOAD = 3, 64 FULL_PRERENDERED_PAGE_LOAD = 3,
63 }; 65 };
64 66
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const content::NotificationSource& source, 130 const content::NotificationSource& source,
129 const content::NotificationDetails& details) override; 131 const content::NotificationDetails& details) override;
130 132
131 // Overridden from favicon::FaviconDriverObserver: 133 // Overridden from favicon::FaviconDriverObserver:
132 void OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, 134 void OnFaviconUpdated(favicon::FaviconDriver* favicon_driver,
133 NotificationIconType notification_icon_type, 135 NotificationIconType notification_icon_type,
134 const GURL& icon_url, 136 const GURL& icon_url,
135 bool icon_url_changed, 137 bool icon_url_changed,
136 const gfx::Image& image) override; 138 const gfx::Image& image) override;
137 139
140 // MediaIPHManagerClient implementation.
141 bool ShowMediaDownloadIPH() override;
142 void UpdateMediaDownloadIPHPosition(const gfx::Rect& rect_in_frame) override;
143 void DismissMediaDownloadIPH() override;
144
138 // Returns true if this tab is currently presented in the context of custom 145 // Returns true if this tab is currently presented in the context of custom
139 // tabs. Tabs can be moved between different activities so the returned value 146 // tabs. Tabs can be moved between different activities so the returned value
140 // might change over the lifetime of the tab. 147 // might change over the lifetime of the tab.
141 bool IsCurrentlyACustomTab(); 148 bool IsCurrentlyACustomTab();
142 149
143 // Methods called from Java via JNI ----------------------------------------- 150 // Methods called from Java via JNI -----------------------------------------
144 151
145 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); 152 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
146 void InitWebContents( 153 void InitWebContents(
147 JNIEnv* env, 154 JNIEnv* env,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 246
240 const std::string& GetWebappManifestScope() const { 247 const std::string& GetWebappManifestScope() const {
241 return webapp_manifest_scope_; 248 return webapp_manifest_scope_;
242 } 249 }
243 250
244 void EnableEmbeddedMediaExperience( 251 void EnableEmbeddedMediaExperience(
245 JNIEnv* env, 252 JNIEnv* env,
246 const base::android::JavaParamRef<jobject>& obj, 253 const base::android::JavaParamRef<jobject>& obj,
247 jboolean enabled); 254 jboolean enabled);
248 255
256 void DownloadMediaIPHDismissed(
257 JNIEnv* env,
258 const base::android::JavaParamRef<jobject>& obj);
259
249 bool ShouldEnableEmbeddedMediaExperience() const; 260 bool ShouldEnableEmbeddedMediaExperience() const;
250 261
251 scoped_refptr<content::DevToolsAgentHost> GetDevToolsAgentHost(); 262 scoped_refptr<content::DevToolsAgentHost> GetDevToolsAgentHost();
252 263
253 void SetDevToolsAgentHost(scoped_refptr<content::DevToolsAgentHost> host); 264 void SetDevToolsAgentHost(scoped_refptr<content::DevToolsAgentHost> host);
254 265
255 void AttachDetachedTab(JNIEnv* env, 266 void AttachDetachedTab(JNIEnv* env,
256 const base::android::JavaParamRef<jobject>& obj); 267 const base::android::JavaParamRef<jobject>& obj);
257 268
258 // Register the Tab's native methods through JNI. 269 // Register the Tab's native methods through JNI.
(...skipping 13 matching lines...) Expand all
272 content::NotificationRegistrar notification_registrar_; 283 content::NotificationRegistrar notification_registrar_;
273 284
274 scoped_refptr<cc::Layer> content_layer_; 285 scoped_refptr<cc::Layer> content_layer_;
275 android::TabContentManager* tab_content_manager_; 286 android::TabContentManager* tab_content_manager_;
276 287
277 std::unique_ptr<content::WebContents> web_contents_; 288 std::unique_ptr<content::WebContents> web_contents_;
278 std::unique_ptr<android::TabWebContentsDelegateAndroid> 289 std::unique_ptr<android::TabWebContentsDelegateAndroid>
279 web_contents_delegate_; 290 web_contents_delegate_;
280 scoped_refptr<content::DevToolsAgentHost> devtools_host_; 291 scoped_refptr<content::DevToolsAgentHost> devtools_host_;
281 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; 292 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_;
293 std::unique_ptr<MediaIPHManager> media_iph_manager_;
282 294
283 std::string webapp_manifest_scope_; 295 std::string webapp_manifest_scope_;
284 bool embedded_media_experience_enabled_; 296 bool embedded_media_experience_enabled_;
285 297
286 DISALLOW_COPY_AND_ASSIGN(TabAndroid); 298 DISALLOW_COPY_AND_ASSIGN(TabAndroid);
287 }; 299 };
288 300
289 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 301 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698