OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ui::ViewAndroid* view_android, | 43 ui::ViewAndroid* view_android, |
44 ui::WindowAndroid* window_android, | 44 ui::WindowAndroid* window_android, |
45 jobject java_bridge_retained_object_set); | 45 jobject java_bridge_retained_object_set); |
46 | 46 |
47 // ContentViewCore implementation. | 47 // ContentViewCore implementation. |
48 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | 48 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
49 virtual WebContents* GetWebContents() const OVERRIDE; | 49 virtual WebContents* GetWebContents() const OVERRIDE; |
50 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; | 50 virtual ui::ViewAndroid* GetViewAndroid() const OVERRIDE; |
51 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; | 51 virtual ui::WindowAndroid* GetWindowAndroid() const OVERRIDE; |
52 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; | 52 virtual scoped_refptr<cc::Layer> GetLayer() const OVERRIDE; |
53 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | |
54 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 53 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
55 virtual void GetScaledContentBitmap( | 54 virtual void GetScaledContentBitmap( |
56 float scale, | 55 float scale, |
57 jobject bitmap_config, | 56 jobject bitmap_config, |
58 gfx::Rect src_subrect, | 57 gfx::Rect src_subrect, |
59 const base::Callback<void(bool, const SkBitmap&)>& result_callback) | 58 const base::Callback<void(bool, const SkBitmap&)>& result_callback) |
60 OVERRIDE; | 59 OVERRIDE; |
61 virtual float GetDpiScale() const OVERRIDE; | 60 virtual float GetDpiScale() const OVERRIDE; |
62 virtual void PauseVideo() OVERRIDE; | 61 virtual void PauseVideo() OVERRIDE; |
63 virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE; | 62 virtual void PauseOrResumeGeolocation(bool should_pause) OVERRIDE; |
64 virtual void RequestTextSurroundingSelection( | 63 virtual void RequestTextSurroundingSelection( |
65 int max_length, | 64 int max_length, |
66 const base::Callback<void(const base::string16& content, | 65 const base::Callback<void(const base::string16& content, |
67 int start_offset, | 66 int start_offset, |
68 int end_offset)>& callback) OVERRIDE; | 67 int end_offset)>& callback) OVERRIDE; |
69 | 68 |
70 // -------------------------------------------------------------------------- | 69 // -------------------------------------------------------------------------- |
71 // Methods called from Java via JNI | 70 // Methods called from Java via JNI |
72 // -------------------------------------------------------------------------- | 71 // -------------------------------------------------------------------------- |
73 | 72 |
74 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, | 73 base::android::ScopedJavaLocalRef<jobject> GetWebContentsAndroid(JNIEnv* env, |
75 jobject obj); | 74 jobject obj); |
76 | 75 |
77 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); | 76 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); |
78 | 77 |
79 // Notifies the ContentViewCore that items were selected in the currently | 78 // Notifies the ContentViewCore that items were selected in the currently |
80 // showing select popup. | 79 // showing select popup. |
81 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); | 80 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); |
82 | |
83 void LoadUrl( | |
84 JNIEnv* env, jobject obj, | |
85 jstring url, | |
86 jint load_url_type, | |
87 jint transition_type, | |
88 jstring j_referrer_url, | |
89 jint referrer_policy, | |
90 jint ua_override_option, | |
91 jstring extra_headers, | |
92 jbyteArray post_data, | |
93 jstring base_url_for_data_url, | |
94 jstring virtual_url_for_data_url, | |
95 jboolean can_load_local_resources, | |
96 jboolean is_renderer_initiated); | |
97 base::android::ScopedJavaLocalRef<jstring> GetURL(JNIEnv* env, jobject) const; | 81 base::android::ScopedJavaLocalRef<jstring> GetURL(JNIEnv* env, jobject) const; |
98 jboolean IsIncognito(JNIEnv* env, jobject obj); | 82 jboolean IsIncognito(JNIEnv* env, jobject obj); |
99 void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation); | 83 void SendOrientationChangeEvent(JNIEnv* env, jobject obj, jint orientation); |
100 jboolean OnTouchEvent(JNIEnv* env, | 84 jboolean OnTouchEvent(JNIEnv* env, |
101 jobject obj, | 85 jobject obj, |
102 jobject motion_event, | 86 jobject motion_event, |
103 jlong time_ms, | 87 jlong time_ms, |
104 jint android_action, | 88 jint android_action, |
105 jint pointer_count, | 89 jint pointer_count, |
106 jint history_size, | 90 jint history_size, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 jfloat x1, jfloat y1, | 135 jfloat x1, jfloat y1, |
152 jfloat x2, jfloat y2); | 136 jfloat x2, jfloat y2); |
153 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y); | 137 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y); |
154 | 138 |
155 void ResetGestureDetection(JNIEnv* env, jobject obj); | 139 void ResetGestureDetection(JNIEnv* env, jobject obj); |
156 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled); | 140 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled); |
157 void SetMultiTouchZoomSupportEnabled(JNIEnv* env, | 141 void SetMultiTouchZoomSupportEnabled(JNIEnv* env, |
158 jobject obj, | 142 jobject obj, |
159 jboolean enabled); | 143 jboolean enabled); |
160 | 144 |
161 void ClearHistory(JNIEnv* env, jobject obj); | |
162 void EvaluateJavaScript(JNIEnv* env, | 145 void EvaluateJavaScript(JNIEnv* env, |
163 jobject obj, | 146 jobject obj, |
164 jstring script, | 147 jstring script, |
165 jobject callback, | 148 jobject callback, |
166 jboolean start_renderer); | 149 jboolean start_renderer); |
167 void PostMessageToFrame(JNIEnv* env, jobject obj, jstring frame_id, | 150 void PostMessageToFrame(JNIEnv* env, jobject obj, jstring frame_id, |
168 jstring message, jstring source_origin, jstring target_origin); | 151 jstring message, jstring source_origin, jstring target_origin); |
169 long GetNativeImeAdapter(JNIEnv* env, jobject obj); | 152 long GetNativeImeAdapter(JNIEnv* env, jobject obj); |
170 void SetFocus(JNIEnv* env, jobject obj, jboolean focused); | 153 void SetFocus(JNIEnv* env, jobject obj, jboolean focused); |
171 | 154 |
172 jint GetBackgroundColor(JNIEnv* env, jobject obj); | 155 jint GetBackgroundColor(JNIEnv* env, jobject obj); |
173 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color); | 156 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color); |
174 void ClearSslPreferences(JNIEnv* env, jobject /* obj */); | |
175 void SetUseDesktopUserAgent(JNIEnv* env, | |
176 jobject /* obj */, | |
177 jboolean state, | |
178 jboolean reload_on_state_change); | |
179 bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */); | |
180 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, | 157 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, |
181 jobject obj, | 158 jobject obj, |
182 jboolean allow); | 159 jboolean allow); |
183 void AddJavascriptInterface(JNIEnv* env, | 160 void AddJavascriptInterface(JNIEnv* env, |
184 jobject obj, | 161 jobject obj, |
185 jobject object, | 162 jobject object, |
186 jstring name, | 163 jstring name, |
187 jclass safe_annotation_clazz); | 164 jclass safe_annotation_clazz); |
188 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 165 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
189 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history); | |
190 void GetDirectedNavigationHistory(JNIEnv* env, | |
191 jobject obj, | |
192 jobject history, | |
193 jboolean is_forward, | |
194 jint max_entries); | |
195 base::android::ScopedJavaLocalRef<jstring> | |
196 GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj); | |
197 void WasResized(JNIEnv* env, jobject obj); | 166 void WasResized(JNIEnv* env, jobject obj); |
198 | 167 |
199 void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled); | 168 void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled); |
200 | 169 |
201 void ExtractSmartClipData(JNIEnv* env, | 170 void ExtractSmartClipData(JNIEnv* env, |
202 jobject obj, | 171 jobject obj, |
203 jint x, | 172 jint x, |
204 jint y, | 173 jint y, |
205 jint width, | 174 jint width, |
206 jint height); | 175 jint height); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 java_bridge_dispatcher_host_; | 351 java_bridge_dispatcher_host_; |
383 | 352 |
384 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 353 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
385 }; | 354 }; |
386 | 355 |
387 bool RegisterContentViewCore(JNIEnv* env); | 356 bool RegisterContentViewCore(JNIEnv* env); |
388 | 357 |
389 } // namespace content | 358 } // namespace content |
390 | 359 |
391 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 360 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |