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_helper.h" | 10 #include "base/android/jni_helper.h" |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 class SkBitmap; | 16 class SkBitmap; |
| 17 class TabContents; |
17 | 18 |
18 namespace browser_sync { | 19 namespace browser_sync { |
19 class SyncedTabDelegate; | 20 class SyncedTabDelegate; |
20 } | 21 } |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 struct ContextMenuParams; | 24 struct ContextMenuParams; |
24 class WebContents; | 25 class WebContents; |
25 } | 26 } |
26 | 27 |
27 class TabAndroid { | 28 class TabAndroid { |
28 public: | 29 public: |
29 TabAndroid(); | 30 TabAndroid(); |
30 | 31 |
31 // Convenience method to retrieve the Tab associated with the passed | 32 // Convenience method to retrieve the Tab associated with the passed |
32 // WebContents. Can return NULL. | 33 // WebContents. Can return NULL. |
33 static TabAndroid* FromWebContents(content::WebContents* web_contents); | 34 static TabAndroid* FromWebContents(content::WebContents* web_contents); |
34 | 35 |
35 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); | 36 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); |
36 | 37 |
| 38 static TabContents* GetOrCreateTabContents( |
| 39 content::WebContents* web_contents); |
| 40 |
| 41 static TabContents* InitTabContentsFromView(JNIEnv* env, |
| 42 jobject content_view); |
| 43 |
37 virtual browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() = 0; | 44 virtual browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() = 0; |
38 | 45 |
39 int id() const { | 46 int id() const { |
40 return tab_id_; | 47 return tab_id_; |
41 } | 48 } |
42 | 49 |
43 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, | 50 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, |
44 const string16& host, | 51 const string16& host, |
45 const string16& realm) = 0; | 52 const string16& realm) = 0; |
46 | 53 |
(...skipping 14 matching lines...) Expand all Loading... |
61 const GURL& url, const string16& title, const SkBitmap& skbitmap, | 68 const GURL& url, const string16& title, const SkBitmap& skbitmap, |
62 int r_value, int g_value, int b_value) = 0; | 69 int r_value, int g_value, int b_value) = 0; |
63 | 70 |
64 protected: | 71 protected: |
65 virtual ~TabAndroid(); | 72 virtual ~TabAndroid(); |
66 | 73 |
67 int tab_id_; | 74 int tab_id_; |
68 }; | 75 }; |
69 | 76 |
70 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | 77 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
OLD | NEW |