Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_TAB_BASE_ANDROID_IMPL_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_TAB_BASE_ANDROID_IMPL_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "chrome/browser/android/tab_android.h" | |
| 13 | |
| 14 class TabContents; | |
| 15 | |
| 16 namespace browser_sync { | |
| 17 class SyncedTabDelegate; | |
| 18 } // namespace browser_sync | |
| 19 | |
| 20 namespace chrome { | |
| 21 namespace android { | |
| 22 class ChromeWebContentsDelegateAndroid; | |
| 23 } // namespace android | |
| 24 } // namespace chrome | |
| 25 | |
| 26 namespace WebKit { | |
| 27 class WebLayer; | |
| 28 } // namespace WebKit | |
| 29 | |
| 30 class TabBaseAndroidImpl : public TabAndroid { | |
| 31 public: | |
| 32 TabBaseAndroidImpl(JNIEnv* env, jobject obj); | |
| 33 void Destroy(JNIEnv* env, jobject obj); | |
| 34 | |
| 35 WebKit::WebLayer* tab_layer() { return tab_layer_.get(); } | |
| 36 | |
| 37 // -------------------------------------------------------------------------- | |
| 38 // TabAndroid Methods | |
| 39 // -------------------------------------------------------------------------- | |
| 40 virtual browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() OVERRIDE; | |
| 41 | |
| 42 virtual void OnReceivedHttpAuthRequest(jobject auth_handler, | |
| 43 const string16& host, | |
|
Ted C
2012/09/20 17:23:59
indent off
David Trainor- moved to gerrit
2012/09/21 22:59:10
Done.
| |
| 44 const string16& realm) OVERRIDE; | |
| 45 virtual void ShowContextMenu( | |
| 46 const content::ContextMenuParams& params) OVERRIDE; | |
| 47 | |
| 48 virtual void ShowCustomContextMenu( | |
| 49 const content::ContextMenuParams& params, | |
| 50 const base::Callback<void(int)>& callback) OVERRIDE; | |
| 51 | |
| 52 virtual void ShowSelectFileDialog( | |
| 53 const base::android::ScopedJavaLocalRef<jobject>& select_file) OVERRIDE; | |
| 54 | |
| 55 virtual void AddShortcutToBookmark( | |
| 56 const GURL& url, const string16& title, const SkBitmap& skbitmap, | |
| 57 int r_value, int g_value, int b_value) OVERRIDE; | |
| 58 | |
| 59 // Called when the common ExternalProtocolHandler wants to | |
| 60 // run the external protocol dialog. | |
| 61 virtual void RunExternalProtocolDialog(const GURL& url) OVERRIDE; | |
| 62 | |
| 63 // register the Tab's native methods through jni | |
| 64 static bool RegisterTabBaseAndroidImpl(JNIEnv* env); | |
| 65 | |
| 66 // -------------------------------------------------------------------------- | |
| 67 // Methods called from Java via JNI | |
| 68 // -------------------------------------------------------------------------- | |
| 69 void InitTabContents(JNIEnv* env, jobject obj, jobject view, | |
| 70 jobject web_contents_delegate); | |
| 71 void DestroyTabContents(JNIEnv* env, jobject obj); | |
| 72 | |
| 73 base::android::ScopedJavaLocalRef<jstring> FixupUrl(JNIEnv* env, | |
| 74 jobject obj, | |
| 75 jstring url); | |
| 76 | |
| 77 protected: | |
| 78 virtual ~TabBaseAndroidImpl(); | |
| 79 | |
| 80 private: | |
| 81 scoped_ptr<TabContents> tab_contents_; | |
| 82 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> | |
| 83 web_contents_delegate_; | |
| 84 scoped_ptr<WebKit::WebLayer> tab_layer_; | |
| 85 | |
| 86 DISALLOW_COPY_AND_ASSIGN(TabBaseAndroidImpl); | |
| 87 }; | |
| 88 | |
| 89 #endif // CHROME_BROWSER_ANDROID_TAB_BASE_ANDROID_IMPL_H_ | |
| OLD | NEW |