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 25 matching lines...) Expand all Loading... |
36 class ContentViewCoreImpl : public ContentViewCore, | 36 class ContentViewCoreImpl : public ContentViewCore, |
37 public NotificationObserver { | 37 public NotificationObserver { |
38 public: | 38 public: |
39 ContentViewCoreImpl(JNIEnv* env, | 39 ContentViewCoreImpl(JNIEnv* env, |
40 jobject obj, | 40 jobject obj, |
41 bool hardware_accelerated, | 41 bool hardware_accelerated, |
42 bool take_ownership_of_web_contents, | 42 bool take_ownership_of_web_contents, |
43 WebContents* web_contents, | 43 WebContents* web_contents, |
44 ui::WindowAndroid* window_android); | 44 ui::WindowAndroid* window_android); |
45 | 45 |
46 // ContentViewCore overrides | 46 // ContentViewCore implementation. |
47 virtual void Destroy(JNIEnv* env, jobject obj) OVERRIDE; | 47 virtual void Destroy(JNIEnv* env, jobject obj) OVERRIDE; |
| 48 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
| 49 virtual WebContents* GetWebContents() const OVERRIDE; |
| 50 virtual ui::WindowAndroid* GetWindowAndroid() OVERRIDE; |
48 | 51 |
49 // -------------------------------------------------------------------------- | 52 // -------------------------------------------------------------------------- |
50 // Methods called from Java via JNI | 53 // Methods called from Java via JNI |
51 // -------------------------------------------------------------------------- | 54 // -------------------------------------------------------------------------- |
52 | 55 |
53 // Notifies the ContentViewCore that items were selected in the currently | 56 // Notifies the ContentViewCore that items were selected in the currently |
54 // showing select popup. | 57 // showing select popup. |
55 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); | 58 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); |
56 | 59 |
57 void LoadUrl( | 60 void LoadUrl( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 jint y, | 104 jint y, |
102 jboolean disambiguation_popup_tap); | 105 jboolean disambiguation_popup_tap); |
103 void PinchBegin(JNIEnv* env, jobject obj, jlong time_ms, jint x, jint y); | 106 void PinchBegin(JNIEnv* env, jobject obj, jlong time_ms, jint x, jint y); |
104 void PinchEnd(JNIEnv* env, jobject obj, jlong time_ms); | 107 void PinchEnd(JNIEnv* env, jobject obj, jlong time_ms); |
105 void PinchBy(JNIEnv* env, | 108 void PinchBy(JNIEnv* env, |
106 jobject obj, | 109 jobject obj, |
107 jlong time_ms, | 110 jlong time_ms, |
108 jint x, | 111 jint x, |
109 jint y, | 112 jint y, |
110 jfloat delta); | 113 jfloat delta); |
111 virtual void SelectBetweenCoordinates(JNIEnv* env, jobject obj, | 114 void SelectBetweenCoordinates(JNIEnv* env, jobject obj, |
112 jint x1, jint y1, | 115 jint x1, jint y1, |
113 jint x2, jint y2) OVERRIDE; | 116 jint x2, jint y2); |
114 jboolean CanGoBack(JNIEnv* env, jobject obj); | 117 jboolean CanGoBack(JNIEnv* env, jobject obj); |
115 jboolean CanGoForward(JNIEnv* env, jobject obj); | 118 jboolean CanGoForward(JNIEnv* env, jobject obj); |
116 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset); | 119 jboolean CanGoToOffset(JNIEnv* env, jobject obj, jint offset); |
117 void GoBack(JNIEnv* env, jobject obj); | 120 void GoBack(JNIEnv* env, jobject obj); |
118 void GoForward(JNIEnv* env, jobject obj); | 121 void GoForward(JNIEnv* env, jobject obj); |
119 void GoToOffset(JNIEnv* env, jobject obj, jint offset); | 122 void GoToOffset(JNIEnv* env, jobject obj, jint offset); |
120 void StopLoading(JNIEnv* env, jobject obj); | 123 void StopLoading(JNIEnv* env, jobject obj); |
121 void Reload(JNIEnv* env, jobject obj); | 124 void Reload(JNIEnv* env, jobject obj); |
122 jboolean NeedsReload(JNIEnv* env, jobject obj); | 125 jboolean NeedsReload(JNIEnv* env, jobject obj); |
123 void ClearHistory(JNIEnv* env, jobject obj); | 126 void ClearHistory(JNIEnv* env, jobject obj); |
124 void SetClient(JNIEnv* env, jobject obj, jobject jclient); | 127 void SetClient(JNIEnv* env, jobject obj, jobject jclient); |
125 jint EvaluateJavaScript(JNIEnv* env, jobject obj, jstring script); | 128 jint EvaluateJavaScript(JNIEnv* env, jobject obj, jstring script); |
126 virtual int GetNativeImeAdapter(JNIEnv* env, jobject obj) OVERRIDE; | 129 int GetNativeImeAdapter(JNIEnv* env, jobject obj); |
127 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | |
128 void AddJavascriptInterface(JNIEnv* env, | 130 void AddJavascriptInterface(JNIEnv* env, |
129 jobject obj, | 131 jobject obj, |
130 jobject object, | 132 jobject object, |
131 jstring name, | 133 jstring name, |
132 jboolean require_annotation); | 134 jboolean require_annotation); |
133 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 135 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
134 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject context); | 136 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject context); |
135 | 137 |
136 // -------------------------------------------------------------------------- | 138 // -------------------------------------------------------------------------- |
137 // Public methods that call to Java via JNI | 139 // Public methods that call to Java via JNI |
(...skipping 29 matching lines...) Expand all Loading... |
167 // Called when page loading begins. | 169 // Called when page loading begins. |
168 void DidStartLoading(); | 170 void DidStartLoading(); |
169 void StartContentIntent(const GURL& content_url); | 171 void StartContentIntent(const GURL& content_url); |
170 | 172 |
171 // -------------------------------------------------------------------------- | 173 // -------------------------------------------------------------------------- |
172 // Methods called from native code | 174 // Methods called from native code |
173 // -------------------------------------------------------------------------- | 175 // -------------------------------------------------------------------------- |
174 | 176 |
175 gfx::Rect GetBounds() const; | 177 gfx::Rect GetBounds() const; |
176 | 178 |
177 WebContents* web_contents() const { return web_contents_; } | 179 void LoadUrl(NavigationController::LoadURLParams& params); |
178 | |
179 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | |
180 virtual ui::WindowAndroid* GetWindowAndroid() OVERRIDE; | |
181 | 180 |
182 private: | 181 private: |
183 // NotificationObserver implementation. | 182 // NotificationObserver implementation. |
184 virtual void Observe(int type, | 183 virtual void Observe(int type, |
185 const NotificationSource& source, | 184 const NotificationSource& source, |
186 const NotificationDetails& details) OVERRIDE; | 185 const NotificationDetails& details) OVERRIDE; |
187 | 186 |
188 // -------------------------------------------------------------------------- | 187 // -------------------------------------------------------------------------- |
189 // Private methods that call to Java via JNI | 188 // Private methods that call to Java via JNI |
190 // -------------------------------------------------------------------------- | 189 // -------------------------------------------------------------------------- |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 ui::WindowAndroid* window_android_; | 227 ui::WindowAndroid* window_android_; |
229 | 228 |
230 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 229 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
231 }; | 230 }; |
232 | 231 |
233 bool RegisterContentViewCore(JNIEnv* env); | 232 bool RegisterContentViewCore(JNIEnv* env); |
234 | 233 |
235 } // namespace content | 234 } // namespace content |
236 | 235 |
237 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 236 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
OLD | NEW |