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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 jfloat x2, jfloat y2); | 137 jfloat x2, jfloat y2); |
154 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y); | 138 void MoveCaret(JNIEnv* env, jobject obj, jfloat x, jfloat y); |
155 void HideTextHandles(JNIEnv* env, jobject obj); | 139 void HideTextHandles(JNIEnv* env, jobject obj); |
156 | 140 |
157 void ResetGestureDetection(JNIEnv* env, jobject obj); | 141 void ResetGestureDetection(JNIEnv* env, jobject obj); |
158 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled); | 142 void SetDoubleTapSupportEnabled(JNIEnv* env, jobject obj, jboolean enabled); |
159 void SetMultiTouchZoomSupportEnabled(JNIEnv* env, | 143 void SetMultiTouchZoomSupportEnabled(JNIEnv* env, |
160 jobject obj, | 144 jobject obj, |
161 jboolean enabled); | 145 jboolean enabled); |
162 | 146 |
163 void ClearHistory(JNIEnv* env, jobject obj); | |
164 void EvaluateJavaScript(JNIEnv* env, | 147 void EvaluateJavaScript(JNIEnv* env, |
165 jobject obj, | 148 jobject obj, |
166 jstring script, | 149 jstring script, |
167 jobject callback, | 150 jobject callback, |
168 jboolean start_renderer); | 151 jboolean start_renderer); |
169 void PostMessageToFrame(JNIEnv* env, jobject obj, jstring frame_id, | 152 void PostMessageToFrame(JNIEnv* env, jobject obj, jstring frame_id, |
170 jstring message, jstring source_origin, jstring target_origin); | 153 jstring message, jstring source_origin, jstring target_origin); |
171 long GetNativeImeAdapter(JNIEnv* env, jobject obj); | 154 long GetNativeImeAdapter(JNIEnv* env, jobject obj); |
172 void SetFocus(JNIEnv* env, jobject obj, jboolean focused); | 155 void SetFocus(JNIEnv* env, jobject obj, jboolean focused); |
173 | 156 |
174 jint GetBackgroundColor(JNIEnv* env, jobject obj); | 157 jint GetBackgroundColor(JNIEnv* env, jobject obj); |
175 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color); | 158 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color); |
176 void ClearSslPreferences(JNIEnv* env, jobject /* obj */); | |
177 void SetUseDesktopUserAgent(JNIEnv* env, | |
178 jobject /* obj */, | |
179 jboolean state, | |
180 jboolean reload_on_state_change); | |
181 bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */); | |
182 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, | 159 void SetAllowJavascriptInterfacesInspection(JNIEnv* env, |
183 jobject obj, | 160 jobject obj, |
184 jboolean allow); | 161 jboolean allow); |
185 void AddJavascriptInterface(JNIEnv* env, | 162 void AddJavascriptInterface(JNIEnv* env, |
186 jobject obj, | 163 jobject obj, |
187 jobject object, | 164 jobject object, |
188 jstring name, | 165 jstring name, |
189 jclass safe_annotation_clazz); | 166 jclass safe_annotation_clazz); |
190 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 167 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
191 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject history); | |
192 void GetDirectedNavigationHistory(JNIEnv* env, | |
193 jobject obj, | |
194 jobject history, | |
195 jboolean is_forward, | |
196 jint max_entries); | |
197 base::android::ScopedJavaLocalRef<jstring> | |
198 GetOriginalUrlForActiveNavigationEntry(JNIEnv* env, jobject obj); | |
199 void WasResized(JNIEnv* env, jobject obj); | 168 void WasResized(JNIEnv* env, jobject obj); |
200 | 169 |
201 void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled); | 170 void SetAccessibilityEnabled(JNIEnv* env, jobject obj, bool enabled); |
202 | 171 |
203 void ExtractSmartClipData(JNIEnv* env, | 172 void ExtractSmartClipData(JNIEnv* env, |
204 jobject obj, | 173 jobject obj, |
205 jint x, | 174 jint x, |
206 jint y, | 175 jint y, |
207 jint width, | 176 jint width, |
208 jint height); | 177 jint height); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 java_bridge_dispatcher_host_; | 355 java_bridge_dispatcher_host_; |
387 | 356 |
388 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 357 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
389 }; | 358 }; |
390 | 359 |
391 bool RegisterContentViewCore(JNIEnv* env); | 360 bool RegisterContentViewCore(JNIEnv* env); |
392 | 361 |
393 } // namespace content | 362 } // namespace content |
394 | 363 |
395 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 364 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |