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_ANDROID_H_ |
| 6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/jni_helper.h" |
| 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/string16.h" |
| 13 |
| 14 class GURL; |
| 15 class OnContextMenuItemSelectedCallBack; |
| 16 class SkBitmap; |
| 17 |
| 18 namespace browser_sync { |
| 19 class SyncedTabDelegate; |
| 20 } |
| 21 |
| 22 namespace content { |
| 23 struct ContextMenuParams; |
| 24 class WebContents; |
| 25 } |
| 26 |
| 27 class TabAndroid { |
| 28 public: |
| 29 TabAndroid(); |
| 30 |
| 31 // Convenience method to retrieve the Tab associated with the passed |
| 32 // WebContents. Can return NULL. |
| 33 static TabAndroid* FromWebContents(content::WebContents* web_contents); |
| 34 |
| 35 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); |
| 36 |
| 37 virtual browser_sync::SyncedTabDelegate* GetSyncedTabDelegate() = 0; |
| 38 |
| 39 int id() const { |
| 40 return tab_id_; |
| 41 } |
| 42 |
| 43 // Called to show the regular context menu that is triggered by a long press. |
| 44 virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; |
| 45 |
| 46 // Called to show a custom context menu. Used by the NTP. |
| 47 virtual void ShowCustomContextMenu( |
| 48 const content::ContextMenuParams& params, |
| 49 OnContextMenuItemSelectedCallBack* callback) = 0; |
| 50 |
| 51 virtual void ShowSelectFileDialog( |
| 52 const base::android::ScopedJavaLocalRef<jobject>& select_file) = 0; |
| 53 |
| 54 // -------------------------------------------------------------------------- |
| 55 // Public methods that call to Java via JNI |
| 56 // -------------------------------------------------------------------------- |
| 57 // Called when context menu option to create the bookmark shortcut on |
| 58 // homescreen is called. |
| 59 virtual void AddShortcutToBookmark( |
| 60 const GURL& url, const string16& title, const SkBitmap& skbitmap, |
| 61 int r_value, int g_value, int b_value) = 0; |
| 62 |
| 63 // TODO(felipeg,tedchoc): Remove this when possible. |
| 64 // http://crbug.com/138216 |
| 65 // Called when the mobile promo action asks to send email. |
| 66 virtual void PromoSendEmail(const string16& data_email, |
| 67 const string16& data_subj, |
| 68 const string16& data_body, |
| 69 const string16& data_inv) = 0; |
| 70 |
| 71 protected: |
| 72 virtual ~TabAndroid(); |
| 73 |
| 74 int tab_id_; |
| 75 }; |
| 76 |
| 77 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
OLD | NEW |