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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 12566007: Wrap calls to GetTouchInputInfo (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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 unified diff | Download patch
OLDNEW
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
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 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 ui::TSFBridge::GetInstance()->CancelComposition(); 2125 ui::TSFBridge::GetInstance()->CancelComposition();
2125 } else { 2126 } else {
2126 ime_input_.CleanupComposition(m_hWnd); 2127 ime_input_.CleanupComposition(m_hWnd);
2127 } 2128 }
2128 2129
2129 // TODO(jschuh): Add support for an arbitrary number of touchpoints. 2130 // TODO(jschuh): Add support for an arbitrary number of touchpoints.
2130 size_t total = std::min(static_cast<int>(LOWORD(wparam)), 2131 size_t total = std::min(static_cast<int>(LOWORD(wparam)),
2131 static_cast<int>(WebKit::WebTouchEvent::touchesLengthCap)); 2132 static_cast<int>(WebKit::WebTouchEvent::touchesLengthCap));
2132 TOUCHINPUT points[WebKit::WebTouchEvent::touchesLengthCap]; 2133 TOUCHINPUT points[WebKit::WebTouchEvent::touchesLengthCap];
2133 2134
2134 if (!total || !GetTouchInputInfo((HTOUCHINPUT)lparam, total, 2135 if (!total || !GetTouchInputInfoWrapper((HTOUCHINPUT)lparam, total,
2135 points, sizeof(TOUCHINPUT))) { 2136 points, sizeof(TOUCHINPUT))) {
2136 TRACE_EVENT0("browser", "EarlyOut_NothingToDo"); 2137 TRACE_EVENT0("browser", "EarlyOut_NothingToDo");
2137 return 0; 2138 return 0;
2138 } 2139 }
2139 2140
2140 if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) { 2141 if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) {
2141 pointer_down_context_ = true; 2142 pointer_down_context_ = true;
2142 last_touch_location_ = gfx::Point( 2143 last_touch_location_ = gfx::Point(
2143 TOUCH_COORD_TO_PIXEL(points[0].x), 2144 TOUCH_COORD_TO_PIXEL(points[0].x),
2144 TOUCH_COORD_TO_PIXEL(points[0].y)); 2145 TOUCH_COORD_TO_PIXEL(points[0].y));
2145 } 2146 }
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 return new RenderWidgetHostViewWin(widget); 3096 return new RenderWidgetHostViewWin(widget);
3096 } 3097 }
3097 3098
3098 // static 3099 // static
3099 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 3100 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
3100 WebKit::WebScreenInfo* results) { 3101 WebKit::WebScreenInfo* results) {
3101 GetScreenInfoForWindow(results, 0); 3102 GetScreenInfoForWindow(results, 0);
3102 } 3103 }
3103 3104
3104 } // namespace content 3105 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698