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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
23 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
24 | 24 |
25 struct WebMenuItem; | 25 struct WebMenuItem; |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
28 class WindowAndroid; | 28 class WindowAndroid; |
29 } | 29 } |
30 | 30 |
31 namespace content { | 31 namespace content { |
32 class ContentViewClient; | |
33 class RenderWidgetHostViewAndroid; | 32 class RenderWidgetHostViewAndroid; |
34 | 33 |
35 // TODO(jrg): this is a shell. Upstream the rest. | 34 // TODO(jrg): this is a shell. Upstream the rest. |
36 class ContentViewCoreImpl : public ContentViewCore, | 35 class ContentViewCoreImpl : public ContentViewCore, |
37 public NotificationObserver { | 36 public NotificationObserver { |
38 public: | 37 public: |
39 ContentViewCoreImpl(JNIEnv* env, | 38 ContentViewCoreImpl(JNIEnv* env, |
40 jobject obj, | 39 jobject obj, |
41 bool hardware_accelerated, | 40 bool hardware_accelerated, |
42 WebContents* web_contents, | 41 WebContents* web_contents, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 jboolean CanGoBack(JNIEnv* env, jobject obj); | 116 jboolean CanGoBack(JNIEnv* env, jobject obj); |
118 jboolean CanGoForward(JNIEnv* env, jobject obj); | 117 jboolean CanGoForward(JNIEnv* env, jobject obj); |
119 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset); | 118 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset); |
120 void GoBack(JNIEnv* env, jobject obj); | 119 void GoBack(JNIEnv* env, jobject obj); |
121 void GoForward(JNIEnv* env, jobject obj); | 120 void GoForward(JNIEnv* env, jobject obj); |
122 void GoToOffset(JNIEnv* env, jobject obj, jint offset); | 121 void GoToOffset(JNIEnv* env, jobject obj, jint offset); |
123 void StopLoading(JNIEnv* env, jobject obj); | 122 void StopLoading(JNIEnv* env, jobject obj); |
124 void Reload(JNIEnv* env, jobject obj); | 123 void Reload(JNIEnv* env, jobject obj); |
125 jboolean NeedsReload(JNIEnv* env, jobject obj); | 124 jboolean NeedsReload(JNIEnv* env, jobject obj); |
126 void ClearHistory(JNIEnv* env, jobject obj); | 125 void ClearHistory(JNIEnv* env, jobject obj); |
127 void SetClient(JNIEnv* env, jobject obj, jobject jclient); | |
128 jint EvaluateJavaScript(JNIEnv* env, jobject obj, jstring script); | 126 jint EvaluateJavaScript(JNIEnv* env, jobject obj, jstring script); |
129 int GetNativeImeAdapter(JNIEnv* env, jobject obj); | 127 int GetNativeImeAdapter(JNIEnv* env, jobject obj); |
130 void AddJavascriptInterface(JNIEnv* env, | 128 void AddJavascriptInterface(JNIEnv* env, |
131 jobject obj, | 129 jobject obj, |
132 jobject object, | 130 jobject object, |
133 jstring name, | 131 jstring name, |
134 jboolean require_annotation); | 132 jboolean require_annotation); |
135 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 133 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
136 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject context); | 134 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject context); |
137 | 135 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 205 |
208 // A weak reference to the Java ContentViewCore object. | 206 // A weak reference to the Java ContentViewCore object. |
209 JavaObjectWeakGlobalRef java_ref_; | 207 JavaObjectWeakGlobalRef java_ref_; |
210 | 208 |
211 NotificationRegistrar notification_registrar_; | 209 NotificationRegistrar notification_registrar_; |
212 | 210 |
213 // Reference to the current WebContents used to determine how and what to | 211 // Reference to the current WebContents used to determine how and what to |
214 // display in the ContentViewCore. | 212 // display in the ContentViewCore. |
215 WebContentsImpl* web_contents_; | 213 WebContentsImpl* web_contents_; |
216 | 214 |
217 // We only set this to be the delegate of the web_contents if we own it. | |
218 scoped_ptr<ContentViewClient> content_view_client_; | |
219 | |
220 // Whether the renderer backing this ContentViewCore has crashed. | 215 // Whether the renderer backing this ContentViewCore has crashed. |
221 bool tab_crashed_; | 216 bool tab_crashed_; |
222 | 217 |
223 // The owning window that has a hold of main application activity. | 218 // The owning window that has a hold of main application activity. |
224 ui::WindowAndroid* window_android_; | 219 ui::WindowAndroid* window_android_; |
225 | 220 |
226 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 221 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
227 }; | 222 }; |
228 | 223 |
229 bool RegisterContentViewCore(JNIEnv* env); | 224 bool RegisterContentViewCore(JNIEnv* env); |
230 | 225 |
231 } // namespace content | 226 } // namespace content |
232 | 227 |
233 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 228 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |