| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 ui::WindowAndroid* window_android); | 43 ui::WindowAndroid* window_android); |
| 44 | 44 |
| 45 // ContentViewCore implementation. | 45 // ContentViewCore implementation. |
| 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; | 46 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() OVERRIDE; |
| 47 virtual WebContents* GetWebContents() const OVERRIDE; | 47 virtual WebContents* GetWebContents() const OVERRIDE; |
| 48 virtual ui::WindowAndroid* GetWindowAndroid() OVERRIDE; | 48 virtual ui::WindowAndroid* GetWindowAndroid() OVERRIDE; |
| 49 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; | 49 virtual void LoadUrl(NavigationController::LoadURLParams& params) OVERRIDE; |
| 50 virtual void OnWebPreferencesUpdated() OVERRIDE; | 50 virtual void OnWebPreferencesUpdated() OVERRIDE; |
| 51 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; | 51 virtual jint GetCurrentRenderProcessId(JNIEnv* env, jobject obj) OVERRIDE; |
| 52 virtual void ShowPastePopup(int x, int y) OVERRIDE; | 52 virtual void ShowPastePopup(int x, int y) OVERRIDE; |
| 53 virtual unsigned int GetScaledContentTexture(const gfx::Size& size) OVERRIDE; |
| 53 | 54 |
| 54 // -------------------------------------------------------------------------- | 55 // -------------------------------------------------------------------------- |
| 55 // Methods called from Java via JNI | 56 // Methods called from Java via JNI |
| 56 // -------------------------------------------------------------------------- | 57 // -------------------------------------------------------------------------- |
| 57 | 58 |
| 58 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); | 59 void OnJavaContentViewCoreDestroyed(JNIEnv* env, jobject obj); |
| 59 | 60 |
| 60 // Notifies the ContentViewCore that items were selected in the currently | 61 // Notifies the ContentViewCore that items were selected in the currently |
| 61 // showing select popup. | 62 // showing select popup. |
| 62 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); | 63 void SelectPopupMenuItems(JNIEnv* env, jobject obj, jintArray indices); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 void Hide(); | 167 void Hide(); |
| 167 void AddJavascriptInterface(JNIEnv* env, | 168 void AddJavascriptInterface(JNIEnv* env, |
| 168 jobject obj, | 169 jobject obj, |
| 169 jobject object, | 170 jobject object, |
| 170 jstring name, | 171 jstring name, |
| 171 jboolean require_annotation); | 172 jboolean require_annotation); |
| 172 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); | 173 void RemoveJavascriptInterface(JNIEnv* env, jobject obj, jstring name); |
| 173 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject context); | 174 int GetNavigationHistory(JNIEnv* env, jobject obj, jobject context); |
| 174 void UpdateVSyncParameters(JNIEnv* env, jobject obj, jlong timebase_micros, | 175 void UpdateVSyncParameters(JNIEnv* env, jobject obj, jlong timebase_micros, |
| 175 jlong interval_micros); | 176 jlong interval_micros); |
| 177 jboolean PopulateBitmapFromCompositor(JNIEnv* env, |
| 178 jobject obj, |
| 179 jobject jbitmap); |
| 176 | 180 |
| 177 // -------------------------------------------------------------------------- | 181 // -------------------------------------------------------------------------- |
| 178 // Public methods that call to Java via JNI | 182 // Public methods that call to Java via JNI |
| 179 // -------------------------------------------------------------------------- | 183 // -------------------------------------------------------------------------- |
| 180 | 184 |
| 181 // Creates a popup menu with |items|. | 185 // Creates a popup menu with |items|. |
| 182 // |multiple| defines if it should support multi-select. | 186 // |multiple| defines if it should support multi-select. |
| 183 // If not |multiple|, |selected_item| sets the initially selected item. | 187 // If not |multiple|, |selected_item| sets the initially selected item. |
| 184 // Otherwise, item's "checked" flag selects it. | 188 // Otherwise, item's "checked" flag selects it. |
| 185 void ShowSelectPopupMenu(const std::vector<WebMenuItem>& items, | 189 void ShowSelectPopupMenu(const std::vector<WebMenuItem>& items, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 235 |
| 232 void InitWebContents(); | 236 void InitWebContents(); |
| 233 | 237 |
| 234 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid(); | 238 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid(); |
| 235 | 239 |
| 236 int GetTouchPadding(); | 240 int GetTouchPadding(); |
| 237 | 241 |
| 238 float DpiScale() const; | 242 float DpiScale() const; |
| 239 WebKit::WebGestureEvent MakeGestureEvent(WebKit::WebInputEvent::Type type, | 243 WebKit::WebGestureEvent MakeGestureEvent(WebKit::WebInputEvent::Type type, |
| 240 long time_ms, int x, int y) const; | 244 long time_ms, int x, int y) const; |
| 245 |
| 246 void DeleteScaledSnapshotTexture(); |
| 247 |
| 241 struct JavaObject; | 248 struct JavaObject; |
| 242 JavaObject* java_object_; | 249 JavaObject* java_object_; |
| 243 | 250 |
| 244 // A weak reference to the Java ContentViewCore object. | 251 // A weak reference to the Java ContentViewCore object. |
| 245 JavaObjectWeakGlobalRef java_ref_; | 252 JavaObjectWeakGlobalRef java_ref_; |
| 246 | 253 |
| 247 NotificationRegistrar notification_registrar_; | 254 NotificationRegistrar notification_registrar_; |
| 248 | 255 |
| 249 // Reference to the current WebContents used to determine how and what to | 256 // Reference to the current WebContents used to determine how and what to |
| 250 // display in the ContentViewCore. | 257 // display in the ContentViewCore. |
| 251 WebContentsImpl* web_contents_; | 258 WebContentsImpl* web_contents_; |
| 252 | 259 |
| 253 // Whether the renderer backing this ContentViewCore has crashed. | 260 // Whether the renderer backing this ContentViewCore has crashed. |
| 254 bool tab_crashed_; | 261 bool tab_crashed_; |
| 255 | 262 |
| 256 float dpi_scale_; | 263 float dpi_scale_; |
| 257 | 264 |
| 258 // The owning window that has a hold of main application activity. | 265 // The owning window that has a hold of main application activity. |
| 259 ui::WindowAndroid* window_android_; | 266 ui::WindowAndroid* window_android_; |
| 260 | 267 |
| 261 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); | 268 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); |
| 262 }; | 269 }; |
| 263 | 270 |
| 264 bool RegisterContentViewCore(JNIEnv* env); | 271 bool RegisterContentViewCore(JNIEnv* env); |
| 265 | 272 |
| 266 } // namespace content | 273 } // namespace content |
| 267 | 274 |
| 268 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ | 275 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ |
| OLD | NEW |