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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 679493002: [Android] Add a native pull-to-refresh overscroll effect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests! Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698