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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Fix non-Android compile issue Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index c0daedb3742ad67bd53a166e75877f14c7c4db38..61ee694b50bf771480b08b93ada71fe3a9cddc88 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -77,6 +77,7 @@
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/android/delegated_frame_host_android.h"
+#include "ui/android/overscroll_refresh_handler.h"
#include "ui/android/window_android.h"
#include "ui/android/window_android_compositor.h"
#include "ui/base/layout.h"
@@ -337,10 +338,12 @@ std::unique_ptr<ui::TouchSelectionController> CreateSelectionController(
}
std::unique_ptr<OverscrollControllerAndroid> CreateOverscrollController(
+ ui::OverscrollRefreshHandler* overscroll_refresh_handler,
ContentViewCoreImpl* content_view_core,
float dpi_scale) {
- return base::MakeUnique<OverscrollControllerAndroid>(content_view_core,
- dpi_scale);
+ return base::MakeUnique<OverscrollControllerAndroid>(
+ overscroll_refresh_handler,
+ content_view_core->GetWindowAndroid()->GetCompositor(), dpi_scale);
}
gfx::RectF GetSelectionRect(const ui::TouchSelectionController& controller) {
@@ -1819,6 +1822,7 @@ void RenderWidgetHostViewAndroid::SetContentViewCore(
if (!overscroll_controller_ &&
view_.GetWindowAndroid()->GetCompositor()) {
overscroll_controller_ = CreateOverscrollController(
+ host_->delegate()->GetDelegateView()->GetOverscrollRefreshHandler(),
content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView()));
}
}
@@ -1886,6 +1890,7 @@ void RenderWidgetHostViewAndroid::OnAttachCompositor() {
DCHECK(content_view_core_);
if (!overscroll_controller_)
boliu 2016/12/03 01:05:28 style: need braces if the body is more than one li
rlanday 2016/12/05 19:53:56 Ok Personally I like the "orthodontist's rule" (y
overscroll_controller_ = CreateOverscrollController(
+ host_->delegate()->GetDelegateView()->GetOverscrollRefreshHandler(),
content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView()));
ui::WindowAndroidCompositor* compositor =
view_.GetWindowAndroid()->GetCompositor();

Powered by Google App Engine
This is Rietveld 408576698