OLD | NEW |
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_in_product_help_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 Loading... |
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 MediaInProductHelpManagerClient { |
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 Loading... |
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 // MediaInProductHelpManagerClient implementation. |
| 141 void ShowMediaDownloadInProductHelp(const gfx::Rect& rect_in_frame) override; |
| 142 void DismissMediaDownloadInProductHelp() override; |
| 143 |
138 // Returns true if this tab is currently presented in the context of custom | 144 // 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 | 145 // tabs. Tabs can be moved between different activities so the returned value |
140 // might change over the lifetime of the tab. | 146 // might change over the lifetime of the tab. |
141 bool IsCurrentlyACustomTab(); | 147 bool IsCurrentlyACustomTab(); |
142 | 148 |
143 // Methods called from Java via JNI ----------------------------------------- | 149 // Methods called from Java via JNI ----------------------------------------- |
144 | 150 |
145 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 151 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
146 void InitWebContents( | 152 void InitWebContents( |
147 JNIEnv* env, | 153 JNIEnv* env, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 245 |
240 const std::string& GetWebappManifestScope() const { | 246 const std::string& GetWebappManifestScope() const { |
241 return webapp_manifest_scope_; | 247 return webapp_manifest_scope_; |
242 } | 248 } |
243 | 249 |
244 void EnableEmbeddedMediaExperience( | 250 void EnableEmbeddedMediaExperience( |
245 JNIEnv* env, | 251 JNIEnv* env, |
246 const base::android::JavaParamRef<jobject>& obj, | 252 const base::android::JavaParamRef<jobject>& obj, |
247 jboolean enabled); | 253 jboolean enabled); |
248 | 254 |
| 255 void DownloadMediaInProductHelpDismissed( |
| 256 JNIEnv* env, |
| 257 const base::android::JavaParamRef<jobject>& obj); |
| 258 |
249 bool ShouldEnableEmbeddedMediaExperience() const; | 259 bool ShouldEnableEmbeddedMediaExperience() const; |
250 | 260 |
251 scoped_refptr<content::DevToolsAgentHost> GetDevToolsAgentHost(); | 261 scoped_refptr<content::DevToolsAgentHost> GetDevToolsAgentHost(); |
252 | 262 |
253 void SetDevToolsAgentHost(scoped_refptr<content::DevToolsAgentHost> host); | 263 void SetDevToolsAgentHost(scoped_refptr<content::DevToolsAgentHost> host); |
254 | 264 |
255 void AttachDetachedTab(JNIEnv* env, | 265 void AttachDetachedTab(JNIEnv* env, |
256 const base::android::JavaParamRef<jobject>& obj); | 266 const base::android::JavaParamRef<jobject>& obj); |
257 | 267 |
258 // Register the Tab's native methods through JNI. | 268 // Register the Tab's native methods through JNI. |
(...skipping 13 matching lines...) Expand all Loading... |
272 content::NotificationRegistrar notification_registrar_; | 282 content::NotificationRegistrar notification_registrar_; |
273 | 283 |
274 scoped_refptr<cc::Layer> content_layer_; | 284 scoped_refptr<cc::Layer> content_layer_; |
275 android::TabContentManager* tab_content_manager_; | 285 android::TabContentManager* tab_content_manager_; |
276 | 286 |
277 std::unique_ptr<content::WebContents> web_contents_; | 287 std::unique_ptr<content::WebContents> web_contents_; |
278 std::unique_ptr<android::TabWebContentsDelegateAndroid> | 288 std::unique_ptr<android::TabWebContentsDelegateAndroid> |
279 web_contents_delegate_; | 289 web_contents_delegate_; |
280 scoped_refptr<content::DevToolsAgentHost> devtools_host_; | 290 scoped_refptr<content::DevToolsAgentHost> devtools_host_; |
281 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; | 291 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; |
| 292 std::unique_ptr<MediaInProductHelpManager> media_iph_manager_; |
282 | 293 |
283 std::string webapp_manifest_scope_; | 294 std::string webapp_manifest_scope_; |
284 bool embedded_media_experience_enabled_; | 295 bool embedded_media_experience_enabled_; |
285 | 296 |
286 DISALLOW_COPY_AND_ASSIGN(TabAndroid); | 297 DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
287 }; | 298 }; |
288 | 299 |
289 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 300 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
OLD | NEW |