OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 741 |
742 gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const { | 742 gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const { |
743 return gfx::ToCeiledSize( | 743 return gfx::ToCeiledSize( |
744 gfx::ScaleSize(GetViewportSizePix(), 1.0f / dpi_scale())); | 744 gfx::ScaleSize(GetViewportSizePix(), 1.0f / dpi_scale())); |
745 } | 745 } |
746 | 746 |
747 float ContentViewCoreImpl::GetTopControlsLayoutHeightDip() const { | 747 float ContentViewCoreImpl::GetTopControlsLayoutHeightDip() const { |
748 return GetTopControlsLayoutHeightPix() / dpi_scale(); | 748 return GetTopControlsLayoutHeightPix() / dpi_scale(); |
749 } | 749 } |
750 | 750 |
| 751 void ContentViewCoreImpl::SetNeedsAnimate() { |
| 752 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 753 if (view) |
| 754 view->SetNeedsAnimate(); |
| 755 } |
| 756 |
751 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { | 757 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { |
752 root_layer_->InsertChild(layer, 0); | 758 root_layer_->InsertChild(layer, 0); |
753 root_layer_->SetIsDrawable(false); | 759 root_layer_->SetIsDrawable(false); |
754 } | 760 } |
755 | 761 |
756 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { | 762 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { |
757 layer->RemoveFromParent(); | 763 layer->RemoveFromParent(); |
758 | 764 |
759 if (!root_layer_->children().size()) | 765 if (!root_layer_->children().size()) |
760 root_layer_->SetIsDrawable(true); | 766 root_layer_->SetIsDrawable(true); |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1314 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1309 retained_objects_set); | 1315 retained_objects_set); |
1310 return reinterpret_cast<intptr_t>(view); | 1316 return reinterpret_cast<intptr_t>(view); |
1311 } | 1317 } |
1312 | 1318 |
1313 bool RegisterContentViewCore(JNIEnv* env) { | 1319 bool RegisterContentViewCore(JNIEnv* env) { |
1314 return RegisterNativesImpl(env); | 1320 return RegisterNativesImpl(env); |
1315 } | 1321 } |
1316 | 1322 |
1317 } // namespace content | 1323 } // namespace content |
OLD | NEW |