| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/browser_view_renderer.h" | 8 #include "android_webview/browser/browser_view_renderer.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 | 11 |
| 12 namespace android_webview { | 12 namespace android_webview { |
| 13 | 13 |
| 14 // Native side of java-class of same name. | 14 // Native side of java-class of same name. |
| 15 // Provides utility methods for rendering involving with Java objects. | 15 // Provides utility methods for rendering involving with Java objects. |
| 16 class JavaBrowserViewRendererHelper : public BrowserViewRenderer::JavaHelper { | 16 class JavaBrowserViewRendererHelper : public BrowserViewRenderer::JavaHelper { |
| 17 public: | 17 public: |
| 18 JavaBrowserViewRendererHelper(); | 18 JavaBrowserViewRendererHelper(); |
| 19 virtual ~JavaBrowserViewRendererHelper(); | 19 virtual ~JavaBrowserViewRendererHelper(); |
| 20 | 20 |
| 21 static JavaBrowserViewRendererHelper* GetInstance(); |
| 22 |
| 21 // BrowserViewRenderer::JavaHelper implementation. | 23 // BrowserViewRenderer::JavaHelper implementation. |
| 22 virtual base::android::ScopedJavaLocalRef<jobject> CreateBitmap( | 24 virtual base::android::ScopedJavaLocalRef<jobject> CreateBitmap( |
| 23 JNIEnv* env, | 25 JNIEnv* env, |
| 24 int width, | 26 int width, |
| 25 int height, | 27 int height, |
| 26 const base::android::JavaRef<jobject>& jcanvas, | 28 const base::android::JavaRef<jobject>& jcanvas, |
| 27 void* owner_key) OVERRIDE; | 29 void* owner_key) OVERRIDE; |
| 28 virtual void DrawBitmapIntoCanvas( | 30 virtual void DrawBitmapIntoCanvas( |
| 29 JNIEnv* env, | 31 JNIEnv* env, |
| 30 const base::android::JavaRef<jobject>& jbitmap, | 32 const base::android::JavaRef<jobject>& jbitmap, |
| 31 const base::android::JavaRef<jobject>& jcanvas, | 33 const base::android::JavaRef<jobject>& jcanvas, |
| 32 int x, | 34 int x, |
| 33 int y) OVERRIDE; | 35 int y) OVERRIDE; |
| 34 virtual base::android::ScopedJavaLocalRef<jobject> RecordBitmapIntoPicture( | 36 virtual base::android::ScopedJavaLocalRef<jobject> RecordBitmapIntoPicture( |
| 35 JNIEnv* env, | 37 JNIEnv* env, |
| 36 const base::android::JavaRef<jobject>& jbitmap) OVERRIDE; | 38 const base::android::JavaRef<jobject>& jbitmap) OVERRIDE; |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 bool RegisterJavaBrowserViewRendererHelper(JNIEnv* env); | 41 bool RegisterJavaBrowserViewRendererHelper(JNIEnv* env); |
| 40 | 42 |
| 41 } // namespace android_webview | 43 } // namespace android_webview |
| 42 | 44 |
| 43 #endif // ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_ | 45 #endif // ANDROID_WEBVIEW_NATIVE_JAVA_BROWSER_VIEW_RENDERER_HELPER_H_ |
| OLD | NEW |