OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <InputScope.h> | 7 #include <InputScope.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "ui/base/ime/composition_text.h" | 60 #include "ui/base/ime/composition_text.h" |
61 #include "ui/base/ime/win/tsf_input_scope.h" | 61 #include "ui/base/ime/win/tsf_input_scope.h" |
62 #include "ui/base/l10n/l10n_util_win.h" | 62 #include "ui/base/l10n/l10n_util_win.h" |
63 #include "ui/base/text/text_elider.h" | 63 #include "ui/base/text/text_elider.h" |
64 #include "ui/base/touch/touch_device.h" | 64 #include "ui/base/touch/touch_device.h" |
65 #include "ui/base/ui_base_switches.h" | 65 #include "ui/base/ui_base_switches.h" |
66 #include "ui/base/view_prop.h" | 66 #include "ui/base/view_prop.h" |
67 #include "ui/base/win/dpi.h" | 67 #include "ui/base/win/dpi.h" |
68 #include "ui/base/win/hwnd_util.h" | 68 #include "ui/base/win/hwnd_util.h" |
69 #include "ui/base/win/mouse_wheel_util.h" | 69 #include "ui/base/win/mouse_wheel_util.h" |
| 70 #include "ui/base/win/touch_input.h" |
70 #include "ui/gfx/canvas.h" | 71 #include "ui/gfx/canvas.h" |
71 #include "ui/gfx/rect.h" | 72 #include "ui/gfx/rect.h" |
72 #include "ui/gfx/rect_conversions.h" | 73 #include "ui/gfx/rect_conversions.h" |
73 #include "ui/gfx/screen.h" | 74 #include "ui/gfx/screen.h" |
74 #include "webkit/glue/webcursor.h" | 75 #include "webkit/glue/webcursor.h" |
75 #include "webkit/plugins/npapi/plugin_constants_win.h" | 76 #include "webkit/plugins/npapi/plugin_constants_win.h" |
76 #include "webkit/plugins/npapi/webplugin.h" | 77 #include "webkit/plugins/npapi/webplugin.h" |
77 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 78 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
78 #include "win8/util/win8_util.h" | 79 #include "win8/util/win8_util.h" |
79 | 80 |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 ui::TSFBridge::GetInstance()->CancelComposition(); | 2126 ui::TSFBridge::GetInstance()->CancelComposition(); |
2126 } else { | 2127 } else { |
2127 ime_input_.CleanupComposition(m_hWnd); | 2128 ime_input_.CleanupComposition(m_hWnd); |
2128 } | 2129 } |
2129 | 2130 |
2130 // TODO(jschuh): Add support for an arbitrary number of touchpoints. | 2131 // TODO(jschuh): Add support for an arbitrary number of touchpoints. |
2131 size_t total = std::min(static_cast<int>(LOWORD(wparam)), | 2132 size_t total = std::min(static_cast<int>(LOWORD(wparam)), |
2132 static_cast<int>(WebKit::WebTouchEvent::touchesLengthCap)); | 2133 static_cast<int>(WebKit::WebTouchEvent::touchesLengthCap)); |
2133 TOUCHINPUT points[WebKit::WebTouchEvent::touchesLengthCap]; | 2134 TOUCHINPUT points[WebKit::WebTouchEvent::touchesLengthCap]; |
2134 | 2135 |
2135 if (!total || !GetTouchInputInfo((HTOUCHINPUT)lparam, total, | 2136 if (!total || !ui::GetTouchInputInfoWrapper((HTOUCHINPUT)lparam, total, |
2136 points, sizeof(TOUCHINPUT))) { | 2137 points, sizeof(TOUCHINPUT))) { |
2137 TRACE_EVENT0("browser", "EarlyOut_NothingToDo"); | 2138 TRACE_EVENT0("browser", "EarlyOut_NothingToDo"); |
2138 return 0; | 2139 return 0; |
2139 } | 2140 } |
2140 | 2141 |
2141 if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) { | 2142 if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) { |
2142 pointer_down_context_ = true; | 2143 pointer_down_context_ = true; |
2143 last_touch_location_ = gfx::Point( | 2144 last_touch_location_ = gfx::Point( |
2144 TOUCH_COORD_TO_PIXEL(points[0].x) / ui::win::GetUndocumentedDPIScale(), | 2145 TOUCH_COORD_TO_PIXEL(points[0].x) / ui::win::GetUndocumentedDPIScale(), |
2145 TOUCH_COORD_TO_PIXEL(points[0].y) / ui::win::GetUndocumentedDPIScale()); | 2146 TOUCH_COORD_TO_PIXEL(points[0].y) / ui::win::GetUndocumentedDPIScale()); |
2146 } | 2147 } |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3096 return new RenderWidgetHostViewWin(widget); | 3097 return new RenderWidgetHostViewWin(widget); |
3097 } | 3098 } |
3098 | 3099 |
3099 // static | 3100 // static |
3100 void RenderWidgetHostViewPort::GetDefaultScreenInfo( | 3101 void RenderWidgetHostViewPort::GetDefaultScreenInfo( |
3101 WebKit::WebScreenInfo* results) { | 3102 WebKit::WebScreenInfo* results) { |
3102 GetScreenInfoForWindow(results, 0); | 3103 GetScreenInfoForWindow(results, 0); |
3103 } | 3104 } |
3104 | 3105 |
3105 } // namespace content | 3106 } // namespace content |
OLD | NEW |