Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/overscroll_controller_android.h" | 5 #include "content/browser/android/overscroll_controller_android.h" |
| 6 | 6 |
| 7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 switches::kDisablePullToRefreshEffect)) { | 90 switches::kDisablePullToRefreshEffect)) { |
| 91 return nullptr; | 91 return nullptr; |
| 92 } | 92 } |
| 93 | 93 |
| 94 return base::WrapUnique(new OverscrollRefresh(handler)); | 94 return base::WrapUnique(new OverscrollRefresh(handler)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace | 97 } // namespace |
| 98 | 98 |
| 99 OverscrollControllerAndroid::OverscrollControllerAndroid( | 99 OverscrollControllerAndroid::OverscrollControllerAndroid( |
| 100 ContentViewCoreImpl* content_view_core) | 100 ContentViewCoreImpl* content_view_core, |
|
no sievers
2016/07/13 17:51:53
Now you can pass OverscrollRefreshHandler* instead
gsennton
2016/07/13 18:38:39
If we also pass the Compositor yup :P
gsennton
2016/07/13 19:24:30
Can I submit as is or would you like me to change
no sievers
2016/07/13 19:26:32
Ooops nevermind then.
Maybe eventually this can t
| |
| 101 float dpi_scale) | |
| 101 : compositor_(content_view_core->GetWindowAndroid()->GetCompositor()), | 102 : compositor_(content_view_core->GetWindowAndroid()->GetCompositor()), |
| 102 dpi_scale_(content_view_core->GetDpiScale()), | 103 dpi_scale_(dpi_scale), |
| 103 enabled_(true), | 104 enabled_(true), |
| 104 glow_effect_(CreateGlowEffect(this, dpi_scale_)), | 105 glow_effect_(CreateGlowEffect(this, dpi_scale_)), |
| 105 refresh_effect_(CreateRefreshEffect(content_view_core)) { | 106 refresh_effect_(CreateRefreshEffect(content_view_core)) { |
| 106 DCHECK(compositor_); | 107 DCHECK(compositor_); |
| 107 } | 108 } |
| 108 | 109 |
| 109 OverscrollControllerAndroid::~OverscrollControllerAndroid() { | 110 OverscrollControllerAndroid::~OverscrollControllerAndroid() { |
| 110 } | 111 } |
| 111 | 112 |
| 112 bool OverscrollControllerAndroid::WillHandleGestureEvent( | 113 bool OverscrollControllerAndroid::WillHandleGestureEvent( |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 std::unique_ptr<EdgeEffectBase> | 273 std::unique_ptr<EdgeEffectBase> |
| 273 OverscrollControllerAndroid::CreateEdgeEffect() { | 274 OverscrollControllerAndroid::CreateEdgeEffect() { |
| 274 return CreateGlowEdgeEffect(&compositor_->GetResourceManager(), dpi_scale_); | 275 return CreateGlowEdgeEffect(&compositor_->GetResourceManager(), dpi_scale_); |
| 275 } | 276 } |
| 276 | 277 |
| 277 void OverscrollControllerAndroid::SetNeedsAnimate() { | 278 void OverscrollControllerAndroid::SetNeedsAnimate() { |
| 278 compositor_->SetNeedsAnimate(); | 279 compositor_->SetNeedsAnimate(); |
| 279 } | 280 } |
| 280 | 281 |
| 281 } // namespace content | 282 } // namespace content |
| OLD | NEW |