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 "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/output/compositor_frame_metadata.h" | 10 #include "cc/output/compositor_frame_metadata.h" |
11 #include "content/browser/android/content_view_core_impl.h" | 11 #include "content/browser/android/content_view_core_impl.h" |
12 #include "content/browser/android/edge_effect.h" | |
13 #include "content/browser/android/edge_effect_l.h" | |
14 #include "content/common/input/did_overscroll_params.h" | 12 #include "content/common/input/did_overscroll_params.h" |
15 #include "content/public/browser/navigation_controller.h" | 13 #include "content/public/browser/navigation_controller.h" |
16 #include "content/public/browser/user_metrics.h" | 14 #include "content/public/browser/user_metrics.h" |
17 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
18 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 17 #include "ui/android/edge_effect.h" |
| 18 #include "ui/android/edge_effect_l.h" |
19 #include "ui/android/resources/resource_manager.h" | 19 #include "ui/android/resources/resource_manager.h" |
20 #include "ui/android/window_android.h" | 20 #include "ui/android/window_android.h" |
21 #include "ui/android/window_android_compositor.h" | 21 #include "ui/android/window_android_compositor.h" |
22 #include "ui/base/l10n/l10n_util_android.h" | 22 #include "ui/base/l10n/l10n_util_android.h" |
23 | 23 |
| 24 using ui::EdgeEffect; |
| 25 using ui::EdgeEffectBase; |
| 26 using ui::EdgeEffectL; |
| 27 using ui::OverscrollGlow; |
| 28 using ui::OverscrollGlowClient; |
| 29 using ui::OverscrollRefresh; |
| 30 using ui::OverscrollRefreshHandler; |
| 31 |
24 namespace content { | 32 namespace content { |
25 namespace { | 33 namespace { |
26 | 34 |
27 // Used for conditional creation of EdgeEffect types for the overscroll glow. | 35 // Used for conditional creation of EdgeEffect types for the overscroll glow. |
28 const int kAndroidLSDKVersion = 21; | 36 const int kAndroidLSDKVersion = 21; |
29 | 37 |
30 // If the glow effect alpha is greater than this value, the refresh effect will | 38 // If the glow effect alpha is greater than this value, the refresh effect will |
31 // be suppressed. This value was experimentally determined to provide a | 39 // be suppressed. This value was experimentally determined to provide a |
32 // reasonable balance between avoiding accidental refresh activation and | 40 // reasonable balance between avoiding accidental refresh activation and |
33 // minimizing the wait required to refresh after the glow has been triggered. | 41 // minimizing the wait required to refresh after the glow has been triggered. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 270 |
263 scoped_ptr<EdgeEffectBase> OverscrollControllerAndroid::CreateEdgeEffect() { | 271 scoped_ptr<EdgeEffectBase> OverscrollControllerAndroid::CreateEdgeEffect() { |
264 return CreateGlowEdgeEffect(&compositor_->GetResourceManager(), dpi_scale_); | 272 return CreateGlowEdgeEffect(&compositor_->GetResourceManager(), dpi_scale_); |
265 } | 273 } |
266 | 274 |
267 void OverscrollControllerAndroid::SetNeedsAnimate() { | 275 void OverscrollControllerAndroid::SetNeedsAnimate() { |
268 compositor_->SetNeedsAnimate(); | 276 compositor_->SetNeedsAnimate(); |
269 } | 277 } |
270 | 278 |
271 } // namespace content | 279 } // namespace content |
OLD | NEW |