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/sync/glue/synced_tab_delegate_android.h" | 18 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" |
19 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 19 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
20 #include "components/favicon/core/favicon_driver_observer.h" | 20 #include "components/favicon/core/favicon_driver_observer.h" |
21 #include "components/infobars/core/infobar_manager.h" | 21 #include "components/infobars/core/infobar_manager.h" |
22 #include "components/sessions/core/session_id.h" | 22 #include "components/sessions/core/session_id.h" |
23 #include "components/toolbar/toolbar_model.h" | 23 #include "components/toolbar/toolbar_model.h" |
24 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
25 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
26 | 26 |
27 class GURL; | 27 class GURL; |
28 class Profile; | 28 class Profile; |
29 | 29 |
30 namespace blimp { | |
31 namespace client { | |
32 class BlimpContents; | |
33 } | |
34 } | |
35 | |
36 namespace cc { | 30 namespace cc { |
37 class Layer; | 31 class Layer; |
38 } | 32 } |
39 | 33 |
40 namespace chrome { | 34 namespace chrome { |
41 struct NavigateParams; | 35 struct NavigateParams; |
42 } | 36 } |
43 | 37 |
44 namespace android { | 38 namespace android { |
45 class TabWebContentsDelegateAndroid; | 39 class TabWebContentsDelegateAndroid; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 static void AttachTabHelpers(content::WebContents* web_contents); | 74 static void AttachTabHelpers(content::WebContents* web_contents); |
81 | 75 |
82 TabAndroid(JNIEnv* env, const base::android::JavaRef<jobject>& obj); | 76 TabAndroid(JNIEnv* env, const base::android::JavaRef<jobject>& obj); |
83 ~TabAndroid() override; | 77 ~TabAndroid() override; |
84 | 78 |
85 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | 79 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
86 | 80 |
87 // Return the WebContents, if any, currently owned by this TabAndroid. | 81 // Return the WebContents, if any, currently owned by this TabAndroid. |
88 content::WebContents* web_contents() const { return web_contents_.get(); } | 82 content::WebContents* web_contents() const { return web_contents_.get(); } |
89 | 83 |
90 // Return the BlimpContents, if any, currently owned by this TabAndroid. | |
91 blimp::client::BlimpContents* blimp_contents() const { | |
92 return blimp_contents_.get(); | |
93 } | |
94 | |
95 // Return the cc::Layer that represents the content for this TabAndroid. | 84 // Return the cc::Layer that represents the content for this TabAndroid. |
96 scoped_refptr<cc::Layer> GetContentLayer() const; | 85 scoped_refptr<cc::Layer> GetContentLayer() const; |
97 | 86 |
98 // Return specific id information regarding this TabAndroid. | 87 // Return specific id information regarding this TabAndroid. |
99 const SessionID& session_id() const { return session_tab_id_; } | 88 const SessionID& session_id() const { return session_tab_id_; } |
100 const SessionID& window_id() const { return session_window_id_; } | 89 const SessionID& window_id() const { return session_window_id_; } |
101 | 90 |
102 int GetAndroidId() const; | 91 int GetAndroidId() const; |
103 int GetSyncId() const; | 92 int GetSyncId() const; |
104 | 93 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Methods called from Java via JNI ----------------------------------------- | 135 // Methods called from Java via JNI ----------------------------------------- |
147 | 136 |
148 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 137 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
149 void InitWebContents( | 138 void InitWebContents( |
150 JNIEnv* env, | 139 JNIEnv* env, |
151 const base::android::JavaParamRef<jobject>& obj, | 140 const base::android::JavaParamRef<jobject>& obj, |
152 jboolean incognito, | 141 jboolean incognito, |
153 const base::android::JavaParamRef<jobject>& jweb_contents, | 142 const base::android::JavaParamRef<jobject>& jweb_contents, |
154 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, | 143 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, |
155 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); | 144 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); |
156 base::android::ScopedJavaLocalRef<jobject> InitBlimpContents( | |
157 JNIEnv* env, | |
158 const base::android::JavaParamRef<jobject>& obj, | |
159 const base::android::JavaParamRef<jobject>& j_profile, | |
160 jlong window_android_ptr); | |
161 void UpdateDelegates( | 145 void UpdateDelegates( |
162 JNIEnv* env, | 146 JNIEnv* env, |
163 const base::android::JavaParamRef<jobject>& obj, | 147 const base::android::JavaParamRef<jobject>& obj, |
164 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, | 148 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, |
165 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); | 149 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); |
166 void DestroyWebContents(JNIEnv* env, | 150 void DestroyWebContents(JNIEnv* env, |
167 const base::android::JavaParamRef<jobject>& obj, | 151 const base::android::JavaParamRef<jobject>& obj, |
168 jboolean delete_native); | 152 jboolean delete_native); |
169 base::android::ScopedJavaLocalRef<jobject> GetProfileAndroid( | 153 base::android::ScopedJavaLocalRef<jobject> GetProfileAndroid( |
170 JNIEnv* env, | 154 JNIEnv* env, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 243 |
260 content::NotificationRegistrar notification_registrar_; | 244 content::NotificationRegistrar notification_registrar_; |
261 | 245 |
262 scoped_refptr<cc::Layer> content_layer_; | 246 scoped_refptr<cc::Layer> content_layer_; |
263 android::TabContentManager* tab_content_manager_; | 247 android::TabContentManager* tab_content_manager_; |
264 | 248 |
265 std::unique_ptr<content::WebContents> web_contents_; | 249 std::unique_ptr<content::WebContents> web_contents_; |
266 std::unique_ptr<android::TabWebContentsDelegateAndroid> | 250 std::unique_ptr<android::TabWebContentsDelegateAndroid> |
267 web_contents_delegate_; | 251 web_contents_delegate_; |
268 | 252 |
269 std::unique_ptr<blimp::client::BlimpContents> blimp_contents_; | |
270 | |
271 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; | 253 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; |
272 | 254 |
273 DISALLOW_COPY_AND_ASSIGN(TabAndroid); | 255 DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
274 }; | 256 }; |
275 | 257 |
276 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 258 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
OLD | NEW |