| 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_RENDER_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "content/public/browser/android/compositor_client.h" | 14 #include "content/public/browser/android/compositor_client.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 16 | 16 |
| 17 namespace ui { |
| 18 class ViewRoot; |
| 19 } |
| 20 |
| 17 namespace content { | 21 namespace content { |
| 18 class Compositor; | 22 class Compositor; |
| 19 | 23 |
| 20 class ContentViewRenderView : public CompositorClient { | 24 class ContentViewRenderView : public CompositorClient { |
| 21 public: | 25 public: |
| 22 // Registers the JNI methods for ContentViewRender. | 26 // Registers the JNI methods for ContentViewRender. |
| 23 static bool RegisterContentViewRenderView(JNIEnv* env); | 27 static bool RegisterContentViewRenderView(JNIEnv* env); |
| 24 | 28 |
| 25 ContentViewRenderView(JNIEnv* env, | 29 ContentViewRenderView(JNIEnv* env, |
| 26 jobject obj, | 30 jobject obj, |
| 27 gfx::NativeWindow root_window); | 31 ui::ViewRoot* view_root_); |
| 28 | 32 |
| 29 // Methods called from Java via JNI ----------------------------------------- | 33 // Methods called from Java via JNI ----------------------------------------- |
| 30 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 34 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 31 void SetCurrentWebContents( | 35 void SetCurrentWebContents( |
| 32 JNIEnv* env, | 36 JNIEnv* env, |
| 33 const base::android::JavaParamRef<jobject>& obj, | 37 const base::android::JavaParamRef<jobject>& obj, |
| 34 const base::android::JavaParamRef<jobject>& jweb_contents); | 38 const base::android::JavaParamRef<jobject>& jweb_contents); |
| 35 void SurfaceCreated(JNIEnv* env, | 39 void SurfaceCreated(JNIEnv* env, |
| 36 const base::android::JavaParamRef<jobject>& obj); | 40 const base::android::JavaParamRef<jobject>& obj); |
| 37 void SurfaceDestroyed(JNIEnv* env, | 41 void SurfaceDestroyed(JNIEnv* env, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 | 56 |
| 53 private: | 57 private: |
| 54 ~ContentViewRenderView() override; | 58 ~ContentViewRenderView() override; |
| 55 | 59 |
| 56 void InitCompositor(); | 60 void InitCompositor(); |
| 57 | 61 |
| 58 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 62 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 59 | 63 |
| 60 std::unique_ptr<content::Compositor> compositor_; | 64 std::unique_ptr<content::Compositor> compositor_; |
| 61 | 65 |
| 62 gfx::NativeWindow root_window_; | 66 ui::ViewRoot* view_root_; |
| 63 int current_surface_format_; | 67 int current_surface_format_; |
| 64 | 68 |
| 65 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); | 69 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 | 72 |
| 69 | 73 |
| 70 } | 74 } |
| 71 | 75 |
| 72 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 76 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| OLD | NEW |