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

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

Issue 1283913002: Improve scroll performance on Windows 10 with high precision touchpads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 4 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/browser/renderer_host/legacy_render_widget_host_win.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/legacy_render_widget_host_win.cc
diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc
index 5126ad2bc2da97d1c829ad9f6913ecaeb5de0424..af9d6b229e1802bf5b3f3378a92ab283a5c8bff5 100644
--- a/content/browser/renderer_host/legacy_render_widget_host_win.cc
+++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc
@@ -75,6 +75,8 @@ HWND LegacyRenderWidgetHostHWND::GetParent() {
void LegacyRenderWidgetHostHWND::Show() {
::ShowWindow(hwnd(), SW_SHOW);
+ if (direct_manipulation_helper_)
+ direct_manipulation_helper_->Activate(hwnd());
}
void LegacyRenderWidgetHostHWND::Hide() {
@@ -86,6 +88,8 @@ void LegacyRenderWidgetHostHWND::SetBounds(const gfx::Rect& bounds) {
::SetWindowPos(hwnd(), NULL, bounds_in_pixel.x(), bounds_in_pixel.y(),
bounds_in_pixel.width(), bounds_in_pixel.height(),
SWP_NOREDRAW);
+ if (direct_manipulation_helper_)
+ direct_manipulation_helper_->SetBounds(bounds_in_pixel);
}
void LegacyRenderWidgetHostHWND::OnFinalMessage(HWND hwnd) {
@@ -126,6 +130,13 @@ bool LegacyRenderWidgetHostHWND::Init() {
CHILDID_SELF);
}
+ // Direct Manipulation is enabled on Windows 10+. The CreateInstance function
+ // returns NULL if Direct Manipulation is not available.
+ direct_manipulation_helper_.reset(
+ gfx::win::DirectManipulationHelper::CreateInstance());
+ if (direct_manipulation_helper_)
+ direct_manipulation_helper_->Initialize(hwnd());
+
return !!SUCCEEDED(hr);
}
@@ -242,6 +253,12 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseRange(UINT message,
handled = TRUE;
}
}
+
+ if (direct_manipulation_helper_ &&
+ (message == WM_MOUSEWHEEL || message == WM_MOUSEHWHEEL)) {
+ direct_manipulation_helper_->HandleMouseWheel(hwnd(), message, w_param,
+ l_param);
+ }
return ret;
}
« no previous file with comments | « content/browser/renderer_host/legacy_render_widget_host_win.h ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698