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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser | 67 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser |
68 enum TabLoadStatus { | 68 enum TabLoadStatus { |
69 PAGE_LOAD_FAILED = 0, | 69 PAGE_LOAD_FAILED = 0, |
70 DEFAULT_PAGE_LOAD = 1, | 70 DEFAULT_PAGE_LOAD = 1, |
71 PARTIAL_PRERENDERED_PAGE_LOAD = 2, | 71 PARTIAL_PRERENDERED_PAGE_LOAD = 2, |
72 FULL_PRERENDERED_PAGE_LOAD = 3, | 72 FULL_PRERENDERED_PAGE_LOAD = 3, |
73 }; | 73 }; |
74 | 74 |
75 // Convenience method to retrieve the Tab associated with the passed | 75 // Convenience method to retrieve the Tab associated with the passed |
76 // WebContents. Can return NULL. | 76 // WebContents. Can return NULL. |
77 static TabAndroid* FromWebContents(content::WebContents* web_contents); | 77 static TabAndroid* FromWebContents(const content::WebContents* web_contents); |
78 | 78 |
79 // Returns the native TabAndroid stored in the Java Tab represented by | 79 // Returns the native TabAndroid stored in the Java Tab represented by |
80 // |obj|. | 80 // |obj|. |
81 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); | 81 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); |
82 | 82 |
83 // Function to attach helpers to the contentView. | 83 // Function to attach helpers to the contentView. |
84 static void AttachTabHelpers(content::WebContents* web_contents); | 84 static void AttachTabHelpers(content::WebContents* web_contents); |
85 | 85 |
86 TabAndroid(JNIEnv* env, jobject obj); | 86 TabAndroid(JNIEnv* env, jobject obj); |
87 ~TabAndroid() override; | 87 ~TabAndroid() override; |
88 | 88 |
89 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | 89 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
90 | 90 |
91 // Return the WebContents, if any, currently owned by this TabAndroid. | 91 // Return the WebContents, if any, currently owned by this TabAndroid. |
92 content::WebContents* web_contents() const { return web_contents_.get(); } | 92 content::WebContents* web_contents() const { return web_contents_.get(); } |
93 | 93 |
94 // Return the cc::Layer that represents the content for this TabAndroid. | 94 // Return the cc::Layer that represents the content for this TabAndroid. |
95 scoped_refptr<cc::Layer> GetContentLayer() const; | 95 scoped_refptr<cc::Layer> GetContentLayer() const; |
96 | 96 |
97 // Return specific id information regarding this TabAndroid. | 97 // Return specific id information regarding this TabAndroid. |
98 const SessionID& session_id() const { return session_tab_id_; } | 98 const SessionID& session_id() const { return session_tab_id_; } |
| 99 const SessionID& window_id() const { return session_window_id_; } |
| 100 |
99 int GetAndroidId() const; | 101 int GetAndroidId() const; |
100 int GetSyncId() const; | 102 int GetSyncId() const; |
101 | 103 |
102 // Return the tab title. | 104 // Return the tab title. |
103 base::string16 GetTitle() const; | 105 base::string16 GetTitle() const; |
104 | 106 |
105 // Return the tab url. | 107 // Return the tab url. |
106 GURL GetURL() const; | 108 GURL GetURL() const; |
107 | 109 |
108 // Load the tab if it was unloaded from memory. | 110 // Load the tab if it was unloaded from memory. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 std::unique_ptr<content::WebContents> web_contents_; | 284 std::unique_ptr<content::WebContents> web_contents_; |
283 std::unique_ptr<chrome::android::TabWebContentsDelegateAndroid> | 285 std::unique_ptr<chrome::android::TabWebContentsDelegateAndroid> |
284 web_contents_delegate_; | 286 web_contents_delegate_; |
285 | 287 |
286 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; | 288 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; |
287 | 289 |
288 DISALLOW_COPY_AND_ASSIGN(TabAndroid); | 290 DISALLOW_COPY_AND_ASSIGN(TabAndroid); |
289 }; | 291 }; |
290 | 292 |
291 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 293 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
OLD | NEW |