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

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

Issue 12454004: Revert 186187 - crashing on Win XP browser_tests with "Access is denied". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/base/win/dpi.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 &touch_event_.touches[touch_event_.touchesLength++]; 2065 &touch_event_.touches[touch_event_.touchesLength++];
2066 point->state = WebKit::WebTouchPoint::StatePressed; 2066 point->state = WebKit::WebTouchPoint::StatePressed;
2067 point->id = GetMappedTouch(touch_input->dwID); 2067 point->id = GetMappedTouch(touch_input->dwID);
2068 UpdateTouchPoint(point, touch_input); 2068 UpdateTouchPoint(point, touch_input);
2069 return point; 2069 return point;
2070 } 2070 }
2071 2071
2072 bool WebTouchState::UpdateTouchPoint( 2072 bool WebTouchState::UpdateTouchPoint(
2073 WebKit::WebTouchPoint* touch_point, 2073 WebKit::WebTouchPoint* touch_point,
2074 TOUCHINPUT* touch_input) { 2074 TOUCHINPUT* touch_input) {
2075 CPoint coordinates( 2075 CPoint coordinates(TOUCH_COORD_TO_PIXEL(touch_input->x),
2076 TOUCH_COORD_TO_PIXEL(touch_input->x) / ui::win::GetDPIScaleFromRegistry(), 2076 TOUCH_COORD_TO_PIXEL(touch_input->y));
2077 TOUCH_COORD_TO_PIXEL(touch_input->y) / ui::win::GetDPIScaleFromRegistry());
2078 int radius_x = 1; 2077 int radius_x = 1;
2079 int radius_y = 1; 2078 int radius_y = 1;
2080 if (touch_input->dwMask & TOUCHINPUTMASKF_CONTACTAREA) { 2079 if (touch_input->dwMask & TOUCHINPUTMASKF_CONTACTAREA) {
2081 radius_x = TOUCH_COORD_TO_PIXEL(touch_input->cxContact); 2080 radius_x = TOUCH_COORD_TO_PIXEL(touch_input->cxContact);
2082 radius_y = TOUCH_COORD_TO_PIXEL(touch_input->cyContact); 2081 radius_y = TOUCH_COORD_TO_PIXEL(touch_input->cyContact);
2083 } 2082 }
2084 2083
2085 // Detect and exclude stationary moves. 2084 // Detect and exclude stationary moves.
2086 if (GetTouchType(*touch_input) == TOUCHEVENTF_MOVE && 2085 if (GetTouchType(*touch_input) == TOUCHEVENTF_MOVE &&
2087 touch_point->screenPosition.x == coordinates.x && 2086 touch_point->screenPosition.x == coordinates.x &&
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 2133
2135 if (!total || !GetTouchInputInfo((HTOUCHINPUT)lparam, total, 2134 if (!total || !GetTouchInputInfo((HTOUCHINPUT)lparam, total,
2136 points, sizeof(TOUCHINPUT))) { 2135 points, sizeof(TOUCHINPUT))) {
2137 TRACE_EVENT0("browser", "EarlyOut_NothingToDo"); 2136 TRACE_EVENT0("browser", "EarlyOut_NothingToDo");
2138 return 0; 2137 return 0;
2139 } 2138 }
2140 2139
2141 if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) { 2140 if (total == 1 && (points[0].dwFlags & TOUCHEVENTF_DOWN)) {
2142 pointer_down_context_ = true; 2141 pointer_down_context_ = true;
2143 last_touch_location_ = gfx::Point( 2142 last_touch_location_ = gfx::Point(
2144 TOUCH_COORD_TO_PIXEL(points[0].x) / ui::win::GetDPIScaleFromRegistry(), 2143 TOUCH_COORD_TO_PIXEL(points[0].x),
2145 TOUCH_COORD_TO_PIXEL(points[0].y) / ui::win::GetDPIScaleFromRegistry()); 2144 TOUCH_COORD_TO_PIXEL(points[0].y));
2146 } 2145 }
2147 2146
2148 bool should_forward = render_widget_host_->ShouldForwardTouchEvent() && 2147 bool should_forward = render_widget_host_->ShouldForwardTouchEvent() &&
2149 touch_events_enabled_; 2148 touch_events_enabled_;
2150 2149
2151 // Send a copy of the touch events on to the gesture recognizer. 2150 // Send a copy of the touch events on to the gesture recognizer.
2152 for (size_t start = 0; start < total;) { 2151 for (size_t start = 0; start < total;) {
2153 start += touch_state_->UpdateTouchPoints(points + start, total - start); 2152 start += touch_state_->UpdateTouchPoints(points + start, total - start);
2154 if (should_forward) { 2153 if (should_forward) {
2155 if (touch_state_->is_changed()) 2154 if (touch_state_->is_changed())
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 return new RenderWidgetHostViewWin(widget); 3090 return new RenderWidgetHostViewWin(widget);
3092 } 3091 }
3093 3092
3094 // static 3093 // static
3095 void RenderWidgetHostViewPort::GetDefaultScreenInfo( 3094 void RenderWidgetHostViewPort::GetDefaultScreenInfo(
3096 WebKit::WebScreenInfo* results) { 3095 WebKit::WebScreenInfo* results) {
3097 GetScreenInfoForWindow(results, 0); 3096 GetScreenInfoForWindow(results, 0);
3098 } 3097 }
3099 3098
3100 } // namespace content 3099 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/base/win/dpi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698