| 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 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace chrome { | 40 namespace chrome { |
| 41 namespace android { | 41 namespace android { |
| 42 class TabWebContentsDelegateAndroid; | 42 class TabWebContentsDelegateAndroid; |
| 43 class TabContentManager; | 43 class TabContentManager; |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| 47 namespace content { | 47 namespace content { |
| 48 class ContentViewCore; | |
| 49 class WebContents; | 48 class WebContents; |
| 50 } | 49 } |
| 51 | 50 |
| 52 namespace infobars { | 51 namespace infobars { |
| 53 class InfoBar; | 52 class InfoBar; |
| 54 } | 53 } |
| 55 | 54 |
| 56 namespace prerender { | 55 namespace prerender { |
| 57 class PrerenderManager; | 56 class PrerenderManager; |
| 58 } | 57 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 base::string16 GetTitle() const; | 104 base::string16 GetTitle() const; |
| 106 | 105 |
| 107 // Return the tab url. | 106 // Return the tab url. |
| 108 GURL GetURL() const; | 107 GURL GetURL() const; |
| 109 | 108 |
| 110 // Load the tab if it was unloaded from memory. | 109 // Load the tab if it was unloaded from memory. |
| 111 bool LoadIfNeeded(); | 110 bool LoadIfNeeded(); |
| 112 | 111 |
| 113 // Helper methods to make it easier to access objects from the associated | 112 // Helper methods to make it easier to access objects from the associated |
| 114 // WebContents. Can return NULL. | 113 // WebContents. Can return NULL. |
| 115 content::ContentViewCore* GetContentViewCore() const; | |
| 116 Profile* GetProfile() const; | 114 Profile* GetProfile() const; |
| 117 browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() const; | 115 browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() const; |
| 118 | 116 |
| 119 void SetWindowSessionID(SessionID::id_type window_id); | 117 void SetWindowSessionID(SessionID::id_type window_id); |
| 120 void SetSyncId(int sync_id); | 118 void SetSyncId(int sync_id); |
| 121 | 119 |
| 122 void HandlePopupNavigation(chrome::NavigateParams* params); | 120 void HandlePopupNavigation(chrome::NavigateParams* params); |
| 123 | 121 |
| 124 bool HasPrerenderedUrl(GURL gurl); | 122 bool HasPrerenderedUrl(GURL gurl); |
| 125 | 123 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 bool icon_url_changed, | 155 bool icon_url_changed, |
| 158 const gfx::Image& image) override; | 156 const gfx::Image& image) override; |
| 159 | 157 |
| 160 // Methods called from Java via JNI ----------------------------------------- | 158 // Methods called from Java via JNI ----------------------------------------- |
| 161 | 159 |
| 162 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 160 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 163 void InitWebContents( | 161 void InitWebContents( |
| 164 JNIEnv* env, | 162 JNIEnv* env, |
| 165 const base::android::JavaParamRef<jobject>& obj, | 163 const base::android::JavaParamRef<jobject>& obj, |
| 166 jboolean incognito, | 164 jboolean incognito, |
| 167 const base::android::JavaParamRef<jobject>& jcontent_view_core, | 165 const base::android::JavaParamRef<jobject>& jweb_contents, |
| 168 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, | 166 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, |
| 169 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); | 167 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); |
| 170 void UpdateDelegates( | 168 void UpdateDelegates( |
| 171 JNIEnv* env, | 169 JNIEnv* env, |
| 172 const base::android::JavaParamRef<jobject>& obj, | 170 const base::android::JavaParamRef<jobject>& obj, |
| 173 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, | 171 const base::android::JavaParamRef<jobject>& jweb_contents_delegate, |
| 174 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); | 172 const base::android::JavaParamRef<jobject>& jcontext_menu_populator); |
| 175 void DestroyWebContents(JNIEnv* env, | 173 void DestroyWebContents(JNIEnv* env, |
| 176 const base::android::JavaParamRef<jobject>& obj, | 174 const base::android::JavaParamRef<jobject>& obj, |
| 177 jboolean delete_native); | 175 jboolean delete_native); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 JNIEnv* env, | 238 JNIEnv* env, |
| 241 const base::android::JavaParamRef<jobject>& obj, | 239 const base::android::JavaParamRef<jobject>& obj, |
| 242 const base::android::JavaParamRef<jobject>& delegate); | 240 const base::android::JavaParamRef<jobject>& delegate); |
| 243 | 241 |
| 244 // TODO(dtrainor): Remove this, pull content_layer() on demand. | 242 // TODO(dtrainor): Remove this, pull content_layer() on demand. |
| 245 void AttachToTabContentManager( | 243 void AttachToTabContentManager( |
| 246 JNIEnv* env, | 244 JNIEnv* env, |
| 247 const base::android::JavaParamRef<jobject>& obj, | 245 const base::android::JavaParamRef<jobject>& obj, |
| 248 const base::android::JavaParamRef<jobject>& jtab_content_manager); | 246 const base::android::JavaParamRef<jobject>& jtab_content_manager); |
| 249 | 247 |
| 250 void AttachOverlayContentViewCore( | 248 void AttachOverlayWebContents( |
| 251 JNIEnv* env, | 249 JNIEnv* env, |
| 252 const base::android::JavaParamRef<jobject>& obj, | 250 const base::android::JavaParamRef<jobject>& obj, |
| 253 const base::android::JavaParamRef<jobject>& jcontent_view_core, | 251 const base::android::JavaParamRef<jobject>& jweb_contents, |
| 254 jboolean visible); | 252 jboolean visible); |
| 255 | 253 |
| 256 void DetachOverlayContentViewCore( | 254 void DetachOverlayWebContents( |
| 257 JNIEnv* env, | 255 JNIEnv* env, |
| 258 const base::android::JavaParamRef<jobject>& obj, | 256 const base::android::JavaParamRef<jobject>& obj, |
| 259 const base::android::JavaParamRef<jobject>& jcontent_view_core); | 257 const base::android::JavaParamRef<jobject>& jweb_contents); |
| 260 | 258 |
| 261 bool HasPrerenderedUrl(JNIEnv* env, | 259 bool HasPrerenderedUrl(JNIEnv* env, |
| 262 const base::android::JavaParamRef<jobject>& obj, | 260 const base::android::JavaParamRef<jobject>& obj, |
| 263 const base::android::JavaParamRef<jstring>& url); | 261 const base::android::JavaParamRef<jstring>& url); |
| 264 | 262 |
| 265 // Register the Tab's native methods through JNI. | 263 // Register the Tab's native methods through JNI. |
| 266 static bool RegisterTabAndroid(JNIEnv* env); | 264 static bool RegisterTabAndroid(JNIEnv* env); |
| 267 | 265 |
| 268 private: | 266 private: |
| 269 prerender::PrerenderManager* GetPrerenderManager() const; | 267 prerender::PrerenderManager* GetPrerenderManager() const; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 284 std::unique_ptr<content::WebContents> web_contents_; | 282 std::unique_ptr<content::WebContents> web_contents_; |
| 285 std::unique_ptr<chrome::android::TabWebContentsDelegateAndroid> | 283 std::unique_ptr<chrome::android::TabWebContentsDelegateAndroid> |
| 286 web_contents_delegate_; | 284 web_contents_delegate_; |
| 287 | 285 |
| 288 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; | 286 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; |
| 289 | 287 |
| 290 DISALLOW_COPY_AND_ASSIGN(TabAndroid); | 288 DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
| 291 }; | 289 }; |
| 292 | 290 |
| 293 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 291 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
| OLD | NEW |