Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: blimp/client/core/contents/blimp_contents_view_android.cc

Issue 2270323004: Add BlimpView to a Chrome tab when Blimp is enabled. (Closed)
Patch Set: Now owned by BlimpContentsViewAndroid and also implemented touch and sizing Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/contents/blimp_contents_view_android.cc
diff --git a/blimp/client/core/contents/blimp_contents_view_android.cc b/blimp/client/core/contents/blimp_contents_view_android.cc
index ce32fc5369d61da8493629cc329c3a53c4d34cf8..3080e8077b45197eb859d9fee9273f5a3b19016f 100644
--- a/blimp/client/core/contents/blimp_contents_view_android.cc
+++ b/blimp/client/core/contents/blimp_contents_view_android.cc
@@ -6,7 +6,9 @@
#include "base/memory/ptr_util.h"
#include "blimp/client/core/contents/android/blimp_contents_impl_android.h"
+#include "blimp/client/core/contents/android/blimp_view.h"
#include "cc/layers/layer.h"
+#include "ui/android/window_android.h"
namespace blimp {
namespace client {
@@ -14,22 +16,28 @@ namespace client {
// static
std::unique_ptr<BlimpContentsView> BlimpContentsView::Create(
BlimpContentsImpl* blimp_contents) {
- return base::MakeUnique<BlimpContentsViewAndroid>(
- blimp_contents->GetBlimpContentsImplAndroid());
+ return base::MakeUnique<BlimpContentsViewAndroid>(blimp_contents);
}
BlimpContentsViewAndroid::BlimpContentsViewAndroid(
- BlimpContentsImplAndroid* blimp_contents) {
- // TODO(khushalsagar): Get the ViewAndroidDelegate from java after it has a
- // BlimpView. Also get the WindowAndroid so this view can add itself as a
- // child to it.
+ BlimpContentsImpl* blimp_contents) {
// TODO(dtrainor): Use the layer from the compositor manager here instead when
// it goes in the BlimpContents.
- view_.SetLayer(cc::Layer::Create());
+ blimp_view_ = base::MakeUnique<BlimpView>(blimp_contents);
+ view_ = base::MakeUnique<ui::ViewAndroid>(
+ blimp_view_->CreateViewAndroidDelegate());
+ view_->SetLayer(cc::Layer::Create());
+ blimp_contents->GetNativeWindow()->AddChild(view_.get());
}
+BlimpContentsViewAndroid::~BlimpContentsViewAndroid() = default;
+
gfx::NativeView BlimpContentsViewAndroid::GetNativeView() {
- return &view_;
+ return view_.get();
+}
+
+BlimpView* BlimpContentsViewAndroid::GetBlimpView() {
+ return blimp_view_.get();
}
} // namespace client

Powered by Google App Engine
This is Rietveld 408576698