| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_helper.h" | 10 #include "base/android/jni_helper.h" |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/process.h" | 15 #include "base/process.h" |
| 16 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 16 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 17 #include "content/browser/web_contents/web_contents_impl.h" | 17 #include "content/browser/web_contents/web_contents_impl.h" |
| 18 #include "content/public/browser/android/content_view_core.h" | 18 #include "content/public/browser/android/content_view_core.h" |
| 19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" |
| 20 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 22 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
| 23 | 24 |
| 24 struct WebMenuItem; | 25 struct WebMenuItem; |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 class ContentViewClient; | 28 class ContentViewClient; |
| 28 class RenderWidgetHostViewAndroid; | 29 class RenderWidgetHostViewAndroid; |
| 29 | 30 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset); | 105 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset); |
| 105 void GoBack(JNIEnv* env, jobject obj); | 106 void GoBack(JNIEnv* env, jobject obj); |
| 106 void GoForward(JNIEnv* env, jobject obj); | 107 void GoForward(JNIEnv* env, jobject obj); |
| 107 void GoToOffset(JNIEnv* env, jobject obj, jint offset); | 108 void GoToOffset(JNIEnv* env, jobject obj, jint offset); |
| 108 jdouble GetLoadProgress(JNIEnv* env, jobject obj) const; | 109 jdouble GetLoadProgress(JNIEnv* env, jobject obj) const; |
| 109 void StopLoading(JNIEnv* env, jobject obj); | 110 void StopLoading(JNIEnv* env, jobject obj); |
| 110 void Reload(JNIEnv* env, jobject obj); | 111 void Reload(JNIEnv* env, jobject obj); |
| 111 jboolean NeedsReload(JNIEnv* env, jobject obj); | 112 jboolean NeedsReload(JNIEnv* env, jobject obj); |
| 112 void ClearHistory(JNIEnv* env, jobject obj); | 113 void ClearHistory(JNIEnv* env, jobject obj); |
| 113 void SetClient(JNIEnv* env, jobject obj, jobject jclient); | 114 void SetClient(JNIEnv* env, jobject obj, jobject jclient); |
| 115 jint EvaluateJavaScript(JNIEnv* env, jobject obj, jstring script); |
| 114 void AddJavascriptInterface(JNIEnv* env, | 116 void AddJavascriptInterface(JNIEnv* env, |
| 115 jobject obj, | 117 jobject obj, |
| 116 jobject object, | 118 jobject object, |
| 117 jstring name, | 119 jstring name, |
| 118 jboolean allow_inherited_methods); | 120 jboolean allow_inherited_methods); |
| 119 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 121 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
| 120 | 122 |
| 121 // -------------------------------------------------------------------------- | 123 // -------------------------------------------------------------------------- |
| 122 // Public methods that call to Java via JNI | 124 // Public methods that call to Java via JNI |
| 123 // -------------------------------------------------------------------------- | 125 // -------------------------------------------------------------------------- |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 188 |
| 187 void SendGestureEvent(WebKit::WebInputEvent::Type type, long time_ms, | 189 void SendGestureEvent(WebKit::WebInputEvent::Type type, long time_ms, |
| 188 int x, int y, | 190 int x, int y, |
| 189 float dx, float dy, bool link_preview_tap); | 191 float dx, float dy, bool link_preview_tap); |
| 190 | 192 |
| 191 void PostLoadUrl(const GURL& url); | 193 void PostLoadUrl(const GURL& url); |
| 192 | 194 |
| 193 struct JavaObject; | 195 struct JavaObject; |
| 194 JavaObject* java_object_; | 196 JavaObject* java_object_; |
| 195 | 197 |
| 198 NotificationRegistrar notification_registrar_; |
| 199 |
| 196 // Reference to the current WebContents used to determine how and what to | 200 // Reference to the current WebContents used to determine how and what to |
| 197 // display in the ContentViewCore. | 201 // display in the ContentViewCore. |
| 198 WebContentsImpl* web_contents_; | 202 WebContentsImpl* web_contents_; |
| 199 | 203 |
| 200 // We only set this to be the delegate of the web_contents if we own it. | 204 // We only set this to be the delegate of the web_contents if we own it. |
| 201 scoped_ptr<ContentViewClient> content_view_client_; | 205 scoped_ptr<ContentViewClient> content_view_client_; |
| 202 | 206 |
| 203 // Whether the renderer backing this ContentViewCore has crashed. | 207 // Whether the renderer backing this ContentViewCore has crashed. |
| 204 bool tab_crashed_; | 208 bool tab_crashed_; |
| 205 | 209 |
| 206 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 210 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 207 }; | 211 }; |
| 208 | 212 |
| 209 bool RegisterContentViewCore(JNIEnv* env); | 213 bool RegisterContentViewCore(JNIEnv* env); |
| 210 | 214 |
| 211 } // namespace content | 215 } // namespace content |
| 212 | 216 |
| 213 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 217 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |