| 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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 | 751 |
| 752 gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const { | 752 gfx::Size ContentViewCoreImpl::GetViewportSizeDip() const { |
| 753 return gfx::ToCeiledSize( | 753 return gfx::ToCeiledSize( |
| 754 gfx::ScaleSize(GetViewportSizePix(), 1.0f / dpi_scale())); | 754 gfx::ScaleSize(GetViewportSizePix(), 1.0f / dpi_scale())); |
| 755 } | 755 } |
| 756 | 756 |
| 757 float ContentViewCoreImpl::GetTopControlsLayoutHeightDip() const { | 757 float ContentViewCoreImpl::GetTopControlsLayoutHeightDip() const { |
| 758 return GetTopControlsLayoutHeightPix() / dpi_scale(); | 758 return GetTopControlsLayoutHeightPix() / dpi_scale(); |
| 759 } | 759 } |
| 760 | 760 |
| 761 void ContentViewCoreImpl::SetNeedsAnimate() { |
| 762 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 763 if (view) |
| 764 view->SetNeedsAnimate(); |
| 765 } |
| 766 |
| 761 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { | 767 void ContentViewCoreImpl::AttachLayer(scoped_refptr<cc::Layer> layer) { |
| 762 root_layer_->InsertChild(layer, 0); | 768 root_layer_->InsertChild(layer, 0); |
| 763 root_layer_->SetIsDrawable(false); | 769 root_layer_->SetIsDrawable(false); |
| 764 } | 770 } |
| 765 | 771 |
| 766 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { | 772 void ContentViewCoreImpl::RemoveLayer(scoped_refptr<cc::Layer> layer) { |
| 767 layer->RemoveFromParent(); | 773 layer->RemoveFromParent(); |
| 768 | 774 |
| 769 if (!root_layer_->children().size()) | 775 if (!root_layer_->children().size()) |
| 770 root_layer_->SetIsDrawable(true); | 776 root_layer_->SetIsDrawable(true); |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1324 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1319 retained_objects_set); | 1325 retained_objects_set); |
| 1320 return reinterpret_cast<intptr_t>(view); | 1326 return reinterpret_cast<intptr_t>(view); |
| 1321 } | 1327 } |
| 1322 | 1328 |
| 1323 bool RegisterContentViewCore(JNIEnv* env) { | 1329 bool RegisterContentViewCore(JNIEnv* env) { |
| 1324 return RegisterNativesImpl(env); | 1330 return RegisterNativesImpl(env); |
| 1325 } | 1331 } |
| 1326 | 1332 |
| 1327 } // namespace content | 1333 } // namespace content |
| OLD | NEW |