| 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_ANDROID_TESTSHELL_TESTSHELL_TAB_H_ | 5 #ifndef CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_ |
| 6 #define CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_ | 6 #define CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace content { | 28 namespace content { |
| 29 class WebContents; | 29 class WebContents; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace ui { | 32 namespace ui { |
| 33 class WindowAndroid; | 33 class WindowAndroid; |
| 34 } | 34 } |
| 35 | 35 |
| 36 class TestShellTab : public TabAndroid { | 36 class TestShellTab : public TabAndroid { |
| 37 public: | 37 public: |
| 38 TestShellTab(JNIEnv* env, | 38 TestShellTab(JNIEnv* env, jobject obj); |
| 39 jobject obj, | |
| 40 content::WebContents* web_contents, | |
| 41 ui::WindowAndroid* window_android); | |
| 42 void Destroy(JNIEnv* env, jobject obj); | 39 void Destroy(JNIEnv* env, jobject obj); |
| 43 | 40 |
| 44 // -------------------------------------------------------------------------- | 41 // -------------------------------------------------------------------------- |
| 45 // TabAndroid Methods | 42 // TabAndroid Methods |
| 46 // -------------------------------------------------------------------------- | 43 // -------------------------------------------------------------------------- |
| 47 virtual content::WebContents* GetWebContents() OVERRIDE; | |
| 48 | |
| 49 virtual browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() OVERRIDE; | 44 virtual browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() OVERRIDE; |
| 50 | 45 |
| 51 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, | 46 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, |
| 52 const string16& host, | 47 const string16& host, |
| 53 const string16& realm) OVERRIDE; | 48 const string16& realm) OVERRIDE; |
| 54 virtual void ShowContextMenu( | 49 virtual void ShowContextMenu( |
| 55 const content::ContextMenuParams& params) OVERRIDE; | 50 const content::ContextMenuParams& params) OVERRIDE; |
| 56 | 51 |
| 57 virtual void ShowCustomContextMenu( | 52 virtual void ShowCustomContextMenu( |
| 58 const content::ContextMenuParams& params, | 53 const content::ContextMenuParams& params, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 75 virtual void HandlePopupNavigation(chrome::NavigateParams* params) OVERRIDE; | 70 virtual void HandlePopupNavigation(chrome::NavigateParams* params) OVERRIDE; |
| 76 virtual int GetSyncId() const OVERRIDE; | 71 virtual int GetSyncId() const OVERRIDE; |
| 77 virtual void SetSyncId(int sync_id) OVERRIDE; | 72 virtual void SetSyncId(int sync_id) OVERRIDE; |
| 78 | 73 |
| 79 // Register the Tab's native methods through JNI. | 74 // Register the Tab's native methods through JNI. |
| 80 static bool RegisterTestShellTab(JNIEnv* env); | 75 static bool RegisterTestShellTab(JNIEnv* env); |
| 81 | 76 |
| 82 // -------------------------------------------------------------------------- | 77 // -------------------------------------------------------------------------- |
| 83 // Methods called from Java via JNI | 78 // Methods called from Java via JNI |
| 84 // -------------------------------------------------------------------------- | 79 // -------------------------------------------------------------------------- |
| 85 void InitWebContentsDelegate(JNIEnv* env, | |
| 86 jobject obj, | |
| 87 jobject web_contents_delegate); | |
| 88 | |
| 89 base::android::ScopedJavaLocalRef<jstring> FixupUrl(JNIEnv* env, | 80 base::android::ScopedJavaLocalRef<jstring> FixupUrl(JNIEnv* env, |
| 90 jobject obj, | 81 jobject obj, |
| 91 jstring url); | 82 jstring url); |
| 92 | 83 |
| 93 protected: | 84 protected: |
| 94 virtual ~TestShellTab(); | 85 virtual ~TestShellTab(); |
| 95 | 86 |
| 96 private: | 87 private: |
| 97 scoped_ptr<content::WebContents> web_contents_; | |
| 98 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> | |
| 99 web_contents_delegate_; | |
| 100 | |
| 101 DISALLOW_COPY_AND_ASSIGN(TestShellTab); | 88 DISALLOW_COPY_AND_ASSIGN(TestShellTab); |
| 102 }; | 89 }; |
| 103 | 90 |
| 104 #endif // CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_ | 91 #endif // CHROME_ANDROID_TESTSHELL_TESTSHELL_TAB_H_ |
| OLD | NEW |