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

Unified Diff: content/renderer/render_view_impl.cc

Issue 1203693003: Setting Accurate ScrollResult from Blink for Elastic Scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 72705a74854f0b8a1758496e4ffd8843d923b3b9..67b6198dd78b7e1c3a754718ac7ba3d0c891c2ba 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -762,7 +762,7 @@ void RenderViewImpl::Initialize(const ViewMsg_New_Params& params,
webview()->settings()->setRootLayerScrolls(
command_line.HasSwitch(switches::kRootLayerScrolls));
- ApplyWebPreferences(webkit_preferences_, webview());
+ ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_);
if (switches::IsTouchDragDropEnabled())
webview()->settings()->setTouchDragDropEnabled(true);
@@ -1507,6 +1507,19 @@ void RenderViewImpl::SendUpdateState(HistoryEntry* entry) {
routing_id_, page_id_, HistoryEntryToPageState(entry)));
}
+void RenderViewImpl::ApplyWebPreferencesInternal(
+ const WebPreferences& prefs,
+ blink::WebView* web_view,
+ CompositorDependencies* compositor_deps) {
+ ApplyWebPreferences(prefs, web_view);
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+ DCHECK(compositor_deps);
+ bool is_elastic_overscroll_enabled =
+ compositor_deps->IsElasticOverscrollEnabled();
+ web_view->settings()->setReportWheelOverscroll(is_elastic_overscroll_enabled);
+#endif
+}
+
bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) {
// Before WebKit asks us to show an alert (etc.), it takes care of doing the
// equivalent of WebView::willEnterModalLoop. In the case of showModalDialog
@@ -2650,7 +2663,7 @@ void RenderViewImpl::OnDragSourceSystemDragEnded() {
void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) {
webkit_preferences_ = prefs;
- ApplyWebPreferences(webkit_preferences_, webview());
+ ApplyWebPreferencesInternal(webkit_preferences_, webview(), compositor_deps_);
}
void RenderViewImpl::OnEnumerateDirectoryResponse(
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698