Index: chrome/browser/android/tab_android.h |
diff --git a/chrome/browser/android/tab_android.h b/chrome/browser/android/tab_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d515ce33cd3362c842e3c035c5d795b2727af71 |
--- /dev/null |
+++ b/chrome/browser/android/tab_android.h |
@@ -0,0 +1,87 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
+#define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |
+ |
+#include <jni.h> |
+ |
+#include "base/android/jni_helper.h" |
+#include "base/android/scoped_java_ref.h" |
+#include "base/compiler_specific.h" |
+#include "base/memory/ref_counted.h" |
Lei Zhang
2012/07/18 18:07:43
nit: Remove unneeded includes, such as both base/m
felipeg
2012/07/19 10:15:36
Done.
|
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/prefs/pref_change_registrar.h" |
+#include "chrome/browser/sync/glue/synced_tab_delegate.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
+#include "googleurl/src/gurl.h" |
Lei Zhang
2012/07/18 18:07:43
nit: forward declare instead.
felipeg
2012/07/19 10:15:36
Done.
|
+#include "third_party/skia/include/core/SkBitmap.h" |
Lei Zhang
2012/07/18 18:07:43
nit: Probably not needed since you forward decl'd
felipeg
2012/07/19 10:15:36
Done.
|
+ |
+class AutofillExternalDelegateAndroid; |
Lei Zhang
2012/07/18 18:07:43
nit: Please remove unneeded forward decls. Ditto f
felipeg
2012/07/19 10:15:36
Done.
|
+class OnContextMenuItemSelectedCallBack; |
+class Profile; |
+class TabContents; |
+class SkBitmap; |
+ |
+namespace content { |
+class ContentViewCore; |
+struct ContextMenuParams; |
+class WebContents; |
+class WebContentsObserver; |
+} |
+ |
+namespace prerender { |
+class PrerenderManager; |
+} |
+ |
+class TabAndroid : public content::NotificationObserver { |
+ public: |
+ TabAndroid() : tab_id_(-1) {} |
Lei Zhang
2012/07/18 18:07:43
Please move ctor/dtor impl into the .cc file.
felipeg
2012/07/19 10:15:36
Done.
|
+ |
+ // Convenience method to retrieve the Tab associated with the passed |
+ // WebContents. Can return NULL. |
+ static TabAndroid* FromWebContents(content::WebContents* web_contents); |
+ |
+ static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); |
+ |
+ virtual browser_sync::SyncedTabDelegate* synced_tab_delegate() = 0; |
+ |
+ int id() const { |
+ return tab_id_; |
+ } |
+ |
+ // Called to show the regular context menu that is triggered by a long press. |
+ virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; |
+ |
+ // Called to show a custom context menu. Used by the NTP. |
+ virtual void ShowCustomContextMenu( |
+ const content::ContextMenuParams& params, |
+ OnContextMenuItemSelectedCallBack* callback) = 0; |
+ |
+ virtual void ShowSelectFileDialog( |
+ const base::android::ScopedJavaLocalRef<jobject>& select_file) = 0; |
+ |
+ // -------------------------------------------------------------------------- |
+ // Public methods that call to Java via JNI |
+ // -------------------------------------------------------------------------- |
+ // Called when context menu option to create the bookmark shortcut on |
+ // homescreen is called. |
+ virtual void AddShortcutToBookmark( |
+ const GURL& url, const string16& title, const SkBitmap& skbitmap, |
+ int r_value, int g_value, int b_value) = 0; |
+ |
+ // Called when the mobile promo action asks to send email. |
+ virtual void PromoSendEmail(const string16& data_email, |
+ const string16& data_subj, |
+ const string16& data_body, |
+ const string16& data_inv) = 0; |
+ |
+ protected: |
+ virtual ~TabAndroid() {} |
+ |
+ int tab_id_; |
+}; |
+ |
+#endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ |