Index: ui/views/win/hwnd_message_handler.cc |
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc |
index 5facaac69cbc08e7a63daed6b5da572f6c25b298..56d032065926d4bb1a36277695a7492e438cb60f 100644 |
--- a/ui/views/win/hwnd_message_handler.cc |
+++ b/ui/views/win/hwnd_message_handler.cc |
@@ -14,6 +14,7 @@ |
#include "ui/base/events/event_utils.h" |
#include "ui/base/gestures/gesture_sequence.h" |
#include "ui/base/keycodes/keyboard_code_conversion_win.h" |
+#include "ui/base/touch/touch_enabled.h" |
#include "ui/base/win/dpi.h" |
#include "ui/base/win/hwnd_util.h" |
#include "ui/base/win/mouse_wheel_util.h" |
@@ -1287,8 +1288,9 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { |
// Get access to a modifiable copy of the system menu. |
GetSystemMenu(hwnd(), false); |
- if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
- RegisterTouchWindow(hwnd(), 0); |
+ if (base::win::GetVersion() >= base::win::VERSION_WIN7 && |
+ ui::AreTouchEventsEnabled()) |
+ RegisterTouchWindow(hwnd(), TWF_WANTPALM); |
// We need to allow the delegate to size its contents since the window may not |
// receive a size notification when its initial bounds are specified at window |