| 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 #include "content/browser/android/content_view_render_view.h" | 5 #include "content/browser/android/content_view_render_view.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 gfx::NativeWindow root_window) | 36 gfx::NativeWindow root_window) |
| 37 : root_window_(root_window), current_surface_format_(0) { | 37 : root_window_(root_window), current_surface_format_(0) { |
| 38 java_obj_.Reset(env, obj); | 38 java_obj_.Reset(env, obj); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ContentViewRenderView::~ContentViewRenderView() { | 41 ContentViewRenderView::~ContentViewRenderView() { |
| 42 } | 42 } |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 static jlong Init(JNIEnv* env, | 45 static jlong Init(JNIEnv* env, |
| 46 jobject obj, | 46 const JavaParamRef<jobject>& obj, |
| 47 jlong native_root_window) { | 47 jlong native_root_window) { |
| 48 gfx::NativeWindow root_window = | 48 gfx::NativeWindow root_window = |
| 49 reinterpret_cast<gfx::NativeWindow>(native_root_window); | 49 reinterpret_cast<gfx::NativeWindow>(native_root_window); |
| 50 ContentViewRenderView* content_view_render_view = | 50 ContentViewRenderView* content_view_render_view = |
| 51 new ContentViewRenderView(env, obj, root_window); | 51 new ContentViewRenderView(env, obj, root_window); |
| 52 return reinterpret_cast<intptr_t>(content_view_render_view); | 52 return reinterpret_cast<intptr_t>(content_view_render_view); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void ContentViewRenderView::Destroy(JNIEnv* env, jobject obj) { | 55 void ContentViewRenderView::Destroy(JNIEnv* env, jobject obj) { |
| 56 delete this; | 56 delete this; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 compositor_.reset(Compositor::Create(this, root_window_)); | 111 compositor_.reset(Compositor::Create(this, root_window_)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 jlong ContentViewRenderView::GetUIResourceProvider(JNIEnv* env, | 114 jlong ContentViewRenderView::GetUIResourceProvider(JNIEnv* env, |
| 115 jobject obj) { | 115 jobject obj) { |
| 116 if (!compositor_) | 116 if (!compositor_) |
| 117 return 0; | 117 return 0; |
| 118 return reinterpret_cast<intptr_t>(&compositor_->GetUIResourceProvider()); | 118 return reinterpret_cast<intptr_t>(&compositor_->GetUIResourceProvider()); |
| 119 } | 119 } |
| 120 } // namespace content | 120 } // namespace content |
| OLD | NEW |