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/compiler_specific.h" | |
13 #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.
| |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "chrome/browser/prefs/pref_change_registrar.h" | |
16 #include "chrome/browser/sync/glue/synced_tab_delegate.h" | |
17 #include "content/public/browser/notification_observer.h" | |
18 #include "content/public/browser/notification_registrar.h" | |
19 #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.
| |
20 #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.
| |
21 | |
22 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.
| |
23 class OnContextMenuItemSelectedCallBack; | |
24 class Profile; | |
25 class TabContents; | |
26 class SkBitmap; | |
27 | |
28 namespace content { | |
29 class ContentViewCore; | |
30 struct ContextMenuParams; | |
31 class WebContents; | |
32 class WebContentsObserver; | |
33 } | |
34 | |
35 namespace prerender { | |
36 class PrerenderManager; | |
37 } | |
38 | |
39 class TabAndroid : public content::NotificationObserver { | |
40 public: | |
41 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.
| |
42 | |
43 // Convenience method to retrieve the Tab associated with the passed | |
44 // WebContents. Can return NULL. | |
45 static TabAndroid* FromWebContents(content::WebContents* web_contents); | |
46 | |
47 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); | |
48 | |
49 virtual browser_sync::SyncedTabDelegate* synced_tab_delegate() = 0; | |
50 | |
51 int id() const { | |
52 return tab_id_; | |
53 } | |
54 | |
55 // Called to show the regular context menu that is triggered by a long press. | |
56 virtual void ShowContextMenu(const content::ContextMenuParams& params) = 0; | |
57 | |
58 // Called to show a custom context menu. Used by the NTP. | |
59 virtual void ShowCustomContextMenu( | |
60 const content::ContextMenuParams& params, | |
61 OnContextMenuItemSelectedCallBack* callback) = 0; | |
62 | |
63 virtual void ShowSelectFileDialog( | |
64 const base::android::ScopedJavaLocalRef<jobject>& select_file) = 0; | |
65 | |
66 // -------------------------------------------------------------------------- | |
67 // Public methods that call to Java via JNI | |
68 // -------------------------------------------------------------------------- | |
69 // Called when context menu option to create the bookmark shortcut on | |
70 // homescreen is called. | |
71 virtual void AddShortcutToBookmark( | |
72 const GURL& url, const string16& title, const SkBitmap& skbitmap, | |
73 int r_value, int g_value, int b_value) = 0; | |
74 | |
75 // Called when the mobile promo action asks to send email. | |
76 virtual void PromoSendEmail(const string16& data_email, | |
77 const string16& data_subj, | |
78 const string16& data_body, | |
79 const string16& data_inv) = 0; | |
80 | |
81 protected: | |
82 virtual ~TabAndroid() {} | |
83 | |
84 int tab_id_; | |
85 }; | |
86 | |
87 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ | |
OLD | NEW |