Chromium Code Reviews| 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 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/favicon/favicon_tab_helper_observer.h" | 14 #include "chrome/browser/favicon/favicon_tab_helper_observer.h" |
| 15 #include "chrome/browser/search/instant_service_observer.h" | 15 #include "chrome/browser/search/instant_service_observer.h" |
| 16 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" | 16 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" |
| 17 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" | 17 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" |
| 18 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 18 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 19 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 19 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 20 #include "components/sessions/session_id.h" | 20 #include "components/sessions/session_id.h" |
| 21 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 23 | 23 |
| 24 class GURL; | 24 class GURL; |
| 25 class Profile; | 25 class Profile; |
| 26 class SkBitmap; | 26 class SkBitmap; |
| 27 | 27 |
| 28 namespace cc { | |
| 29 class Layer; | |
| 30 } | |
| 31 | |
| 28 namespace chrome { | 32 namespace chrome { |
| 29 struct NavigateParams; | 33 struct NavigateParams; |
| 30 } | 34 } |
| 31 | 35 |
| 32 namespace chrome { | 36 namespace chrome { |
| 33 namespace android { | 37 namespace android { |
| 34 class ChromeWebContentsDelegateAndroid; | 38 class ChromeWebContentsDelegateAndroid; |
| 39 class TabContentManager; | |
| 35 } | 40 } |
| 36 } | 41 } |
| 37 | 42 |
| 38 namespace content { | 43 namespace content { |
| 39 class ContentViewCore; | 44 class ContentViewCore; |
| 40 class WebContents; | 45 class WebContents; |
| 41 } | 46 } |
| 42 | 47 |
| 43 namespace prerender { | 48 namespace prerender { |
| 44 class PrerenderManager; | 49 class PrerenderManager; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 71 static void AttachTabHelpers(content::WebContents* web_contents); | 76 static void AttachTabHelpers(content::WebContents* web_contents); |
| 72 | 77 |
| 73 TabAndroid(JNIEnv* env, jobject obj); | 78 TabAndroid(JNIEnv* env, jobject obj); |
| 74 ~TabAndroid() override; | 79 ~TabAndroid() override; |
| 75 | 80 |
| 76 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | 81 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
| 77 | 82 |
| 78 // Return the WebContents, if any, currently owned by this TabAndroid. | 83 // Return the WebContents, if any, currently owned by this TabAndroid. |
| 79 content::WebContents* web_contents() const { return web_contents_.get(); } | 84 content::WebContents* web_contents() const { return web_contents_.get(); } |
| 80 | 85 |
| 86 // Return the cc::Layer that represents the content for this TabAndroid. | |
| 87 scoped_refptr<cc::Layer> GetContentLayer() const; | |
| 88 | |
| 81 // Return specific id information regarding this TabAndroid. | 89 // Return specific id information regarding this TabAndroid. |
| 82 const SessionID& session_id() const { return session_tab_id_; } | 90 const SessionID& session_id() const { return session_tab_id_; } |
| 83 int GetAndroidId() const; | 91 int GetAndroidId() const; |
| 84 int GetSyncId() const; | 92 int GetSyncId() const; |
| 85 | 93 |
| 86 // Return the tab title. | 94 // Return the tab title. |
| 87 base::string16 GetTitle() const; | 95 base::string16 GetTitle() const; |
| 88 | 96 |
| 89 // Return the tab url. | 97 // Return the tab url. |
| 90 GURL GetURL() const; | 98 GURL GetURL() const; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 jint constraints, | 187 jint constraints, |
| 180 jint current, | 188 jint current, |
| 181 jboolean animate); | 189 jboolean animate); |
| 182 | 190 |
| 183 void SearchByImageInNewTabAsync(JNIEnv* env, jobject obj); | 191 void SearchByImageInNewTabAsync(JNIEnv* env, jobject obj); |
| 184 | 192 |
| 185 void SetInterceptNavigationDelegate(JNIEnv* env, | 193 void SetInterceptNavigationDelegate(JNIEnv* env, |
| 186 jobject obj, | 194 jobject obj, |
| 187 jobject delegate); | 195 jobject delegate); |
| 188 | 196 |
| 197 // TODO(dtrainor): Remove this, pull content_layer() on demand. | |
| 198 void AttachToTabContentManager(JNIEnv* env, | |
| 199 jobject obj, | |
|
Ted C
2015/02/06 01:52:39
indenting is off by 2
David Trainor- moved to gerrit
2015/02/06 22:10:24
Done.
| |
| 200 jobject jtab_content_manager); | |
| 201 | |
| 202 void AttachOverlayContentViewCore(JNIEnv* env, | |
| 203 jobject obj, | |
| 204 jobject jcontent_view_core, | |
| 205 jboolean visible); | |
| 206 | |
| 207 void DetachOverlayContentViewCore(JNIEnv* env, | |
| 208 jobject obj, | |
| 209 jobject jcontent_view_core); | |
| 210 | |
| 211 void SetOverlayContentViewCoreVisibility(JNIEnv* env, | |
| 212 jobject obj, | |
| 213 jobject jcontent_view_core, | |
| 214 jboolean visible); | |
| 215 | |
| 189 // Register the Tab's native methods through JNI. | 216 // Register the Tab's native methods through JNI. |
| 190 static bool RegisterTabAndroid(JNIEnv* env); | 217 static bool RegisterTabAndroid(JNIEnv* env); |
| 191 | 218 |
| 192 private: | 219 private: |
| 193 prerender::PrerenderManager* GetPrerenderManager() const; | 220 prerender::PrerenderManager* GetPrerenderManager() const; |
| 194 | 221 |
| 195 JavaObjectWeakGlobalRef weak_java_tab_; | 222 JavaObjectWeakGlobalRef weak_java_tab_; |
| 196 | 223 |
| 197 // The identifier used by session restore for this tab. | 224 // The identifier used by session restore for this tab. |
| 198 SessionID session_tab_id_; | 225 SessionID session_tab_id_; |
| 199 | 226 |
| 200 // Identifier of the window the tab is in. | 227 // Identifier of the window the tab is in. |
| 201 SessionID session_window_id_; | 228 SessionID session_window_id_; |
| 202 | 229 |
| 203 content::NotificationRegistrar notification_registrar_; | 230 content::NotificationRegistrar notification_registrar_; |
| 204 | 231 |
| 232 scoped_refptr<cc::Layer> content_layer_; | |
| 233 chrome::android::TabContentManager* tab_content_manager_; | |
| 234 | |
| 205 scoped_ptr<content::WebContents> web_contents_; | 235 scoped_ptr<content::WebContents> web_contents_; |
| 206 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> | 236 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> |
| 207 web_contents_delegate_; | 237 web_contents_delegate_; |
| 208 | 238 |
| 209 scoped_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; | 239 scoped_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; |
| 210 | 240 |
| 211 DISALLOW_COPY_AND_ASSIGN(TabAndroid); | 241 DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
| 212 }; | 242 }; |
| 213 | 243 |
| 214 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 244 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
| OLD | NEW |