| Index: blimp/client/app/android/blimp_view.cc
|
| diff --git a/blimp/client/app/android/blimp_view.cc b/blimp/client/app/android/blimp_view.cc
|
| index a2c84218bd83510d6e6d9d9c2dff3362d6c65fd6..86dc41a54fcc1f4b9f49e4d0d7a91d593dcb5f00 100644
|
| --- a/blimp/client/app/android/blimp_view.cc
|
| +++ b/blimp/client/app/android/blimp_view.cc
|
| @@ -7,6 +7,8 @@
|
| #include <android/native_window_jni.h>
|
|
|
| #include "blimp/client/app/android/blimp_client_session_android.h"
|
| +#include "blimp/client/core/contents/blimp_contents_impl.h"
|
| +#include "blimp/client/core/render_widget/blimp_render_widget.h"
|
| #include "blimp/net/blimp_stats.h"
|
| #include "jni/BlimpView_jni.h"
|
| #include "ui/events/android/motion_event_android.h"
|
| @@ -50,14 +52,16 @@ BlimpView::BlimpView(JNIEnv* env,
|
| float dp_to_px,
|
| RenderWidgetFeature* render_widget_feature)
|
| : device_scale_factor_(dp_to_px),
|
| - compositor_manager_(
|
| - BlimpCompositorManagerAndroid::Create(real_size,
|
| - size,
|
| - render_widget_feature,
|
| - this)),
|
| + blimp_contents_manager_(true, render_widget_feature),
|
| current_surface_format_(0),
|
| - window_(gfx::kNullAcceleratedWidget) {
|
| + window_(gfx::kNullAcceleratedWidget),
|
| + weak_ptr_factory_(this) {
|
| java_obj_.Reset(env, jobj);
|
| +
|
| + blimp_contents_ = blimp_contents_manager_.CreateBlimpContents();
|
| +
|
| + blimp_contents_->set_did_complete_swap_buffers_callback(base::Bind(
|
| + &BlimpView::OnSwapBuffersCompleted, weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| BlimpView::~BlimpView() {
|
| @@ -84,8 +88,8 @@ void BlimpView::OnSurfaceChanged(JNIEnv* env,
|
| if (jsurface) {
|
| base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env);
|
| window_ = ANativeWindow_fromSurface(env, jsurface);
|
| - compositor_manager_->SetAcceleratedWidget(window_);
|
| - compositor_manager_->SetVisible(true);
|
| + blimp_contents_->SetAcceleratedWidget(window_);
|
| + blimp_contents_->SetVisible(true);
|
| }
|
| }
|
| }
|
| @@ -104,14 +108,14 @@ void BlimpView::OnSurfaceDestroyed(JNIEnv* env,
|
| void BlimpView::SetVisibility(JNIEnv* env,
|
| const JavaParamRef<jobject>& jobj,
|
| jboolean visible) {
|
| - compositor_manager_->SetVisible(visible);
|
| + blimp_contents_->SetVisible(visible);
|
| }
|
|
|
| void BlimpView::ReleaseAcceleratedWidget() {
|
| if (window_ == gfx::kNullAcceleratedWidget)
|
| return;
|
|
|
| - compositor_manager_->ReleaseAcceleratedWidget();
|
| + blimp_contents_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
|
| ANativeWindow_release(window_);
|
| window_ = gfx::kNullAcceleratedWidget;
|
| }
|
| @@ -175,7 +179,11 @@ jboolean BlimpView::OnTouchEvent(JNIEnv* env,
|
| pointer0,
|
| pointer1);
|
|
|
| - return compositor_manager_->OnTouchEvent(event);
|
| + if (blimp_contents_->GetActiveWidget()) {
|
| + return blimp_contents_->GetActiveWidget()->OnTouchEvent(event);
|
| + }
|
| +
|
| + return false;
|
| }
|
|
|
| void BlimpView::OnSwapBuffersCompleted() {
|
| @@ -183,9 +191,5 @@ void BlimpView::OnSwapBuffersCompleted() {
|
| Java_BlimpView_onSwapBuffersCompleted(env, java_obj_.obj());
|
| }
|
|
|
| -void BlimpView::DidCommitAndDrawFrame() {
|
| - BlimpStats::GetInstance()->Add(BlimpStats::COMMIT, 1);
|
| -}
|
| -
|
| } // namespace client
|
| } // namespace blimp
|
|
|