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

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

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Remove unused SwipeRefreshHandler.mNativeSwipeRefreshHandler field Created 4 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 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 981dc1e25c1d669152ca2d4b6cb1ba79b43a038b..2bf58c2faa62d633540c0e11f19c9a6fcf7f0c2f 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.h"
#include "ui/android/window_android.h"
#include "ui/android/window_android_compositor.h"
#include "ui/base/layout.h"
@@ -125,6 +126,8 @@ class PendingReadbackLock : public base::RefCounted<PendingReadbackLock> {
using base::android::ApplicationState;
using base::android::ApplicationStatusListener;
+using base::android::JavaParamRef;
+using base::android::JavaRef;
class GLHelperHolder {
public:
@@ -338,9 +341,11 @@ std::unique_ptr<ui::TouchSelectionController> CreateSelectionController(
std::unique_ptr<OverscrollControllerAndroid> CreateOverscrollController(
ContentViewCoreImpl* content_view_core,
+ const JavaRef<jobject>& overscroll_refresh_handler,
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) {
@@ -436,13 +441,15 @@ void RenderWidgetHostViewAndroid::OnContextLost() {
RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid(
RenderWidgetHostImpl* widget_host,
- ContentViewCoreImpl* content_view_core)
+ ContentViewCoreImpl* content_view_core,
+ const JavaRef<jobject>& overscroll_refresh_handler)
: host_(widget_host),
outstanding_vsync_requests_(0),
is_showing_(!widget_host->is_hidden()),
is_window_visible_(true),
is_window_activity_started_(true),
content_view_core_(nullptr),
+ overscroll_refresh_handler_(nullptr, overscroll_refresh_handler.obj()),
ime_adapter_android_(this),
cached_background_color_(SK_ColorWHITE),
last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId),
@@ -1815,7 +1822,8 @@ void RenderWidgetHostViewAndroid::SetContentViewCore(
if (!overscroll_controller_ &&
view_.GetWindowAndroid()->GetCompositor()) {
overscroll_controller_ = CreateOverscrollController(
- content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView()));
+ content_view_core_, overscroll_refresh_handler_,
+ ui::GetScaleFactorForNativeView(GetNativeView()));
}
}
@@ -1882,7 +1890,8 @@ void RenderWidgetHostViewAndroid::OnAttachCompositor() {
DCHECK(content_view_core_);
if (!overscroll_controller_)
overscroll_controller_ = CreateOverscrollController(
- content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView()));
+ content_view_core_, overscroll_refresh_handler_,
+ ui::GetScaleFactorForNativeView(GetNativeView()));
ui::WindowAndroidCompositor* compositor =
view_.GetWindowAndroid()->GetCompositor();
delegated_frame_host_->RegisterFrameSinkHierarchy(

Powered by Google App Engine
This is Rietveld 408576698