| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "blimp/client/core/contents/blimp_contents_view_android.h" | |
| 6 | |
| 7 #include "base/memory/ptr_util.h" | |
| 8 #include "blimp/client/core/contents/android/blimp_view.h" | |
| 9 #include "blimp/client/core/contents/android/ime_helper_dialog.h" | |
| 10 #include "blimp/client/core/contents/blimp_contents_impl.h" | |
| 11 #include "cc/layers/layer.h" | |
| 12 #include "ui/android/window_android.h" | |
| 13 | |
| 14 namespace blimp { | |
| 15 namespace client { | |
| 16 | |
| 17 // static | |
| 18 std::unique_ptr<BlimpContentsView> BlimpContentsView::Create( | |
| 19 BlimpContentsImpl* blimp_contents, | |
| 20 scoped_refptr<cc::Layer> contents_layer) { | |
| 21 return base::MakeUnique<BlimpContentsViewAndroid>(blimp_contents, | |
| 22 contents_layer); | |
| 23 } | |
| 24 | |
| 25 BlimpContentsViewAndroid::BlimpContentsViewAndroid( | |
| 26 BlimpContentsImpl* blimp_contents, | |
| 27 scoped_refptr<cc::Layer> contents_layer) | |
| 28 : ime_dialog_(new ImeHelperDialog(blimp_contents->GetNativeWindow())) { | |
| 29 blimp_view_ = base::MakeUnique<BlimpView>(blimp_contents); | |
| 30 view_ = base::MakeUnique<ui::ViewAndroid>( | |
| 31 blimp_view_->CreateViewAndroidDelegate()); | |
| 32 view_->SetLayer(contents_layer); | |
| 33 blimp_contents->GetNativeWindow()->AddChild(view_.get()); | |
| 34 } | |
| 35 | |
| 36 BlimpContentsViewAndroid::~BlimpContentsViewAndroid() = default; | |
| 37 | |
| 38 gfx::NativeView BlimpContentsViewAndroid::GetNativeView() { | |
| 39 return view_.get(); | |
| 40 } | |
| 41 | |
| 42 BlimpView* BlimpContentsViewAndroid::GetBlimpView() { | |
| 43 return blimp_view_.get(); | |
| 44 } | |
| 45 | |
| 46 ImeFeature::Delegate* BlimpContentsViewAndroid::GetImeDelegate() { | |
| 47 return ime_dialog_.get(); | |
| 48 } | |
| 49 | |
| 50 } // namespace client | |
| 51 } // namespace blimp | |
| OLD | NEW |