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

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

Issue 11416176: Javascript TouchEvents now get key state mods. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | no next file » | 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 <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <stack> 9 #include <stack>
10 10
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 while (point < end) { 1897 while (point < end) {
1898 if (point->state == WebKit::WebTouchPoint::StateReleased) { 1898 if (point->state == WebKit::WebTouchPoint::StateReleased) {
1899 *point = *(--end); 1899 *point = *(--end);
1900 --touch_event_.touchesLength; 1900 --touch_event_.touchesLength;
1901 } else { 1901 } else {
1902 point->state = WebKit::WebTouchPoint::StateStationary; 1902 point->state = WebKit::WebTouchPoint::StateStationary;
1903 point++; 1903 point++;
1904 } 1904 }
1905 } 1905 }
1906 touch_event_.changedTouchesLength = 0; 1906 touch_event_.changedTouchesLength = 0;
1907 touch_event_.modifiers = content::EventFlagsToWebEventModifiers(
1908 ui::GetModifiersFromKeyState());
1907 1909
1908 // Consume all events of the same type and add them to the changed list. 1910 // Consume all events of the same type and add them to the changed list.
1909 int last_type = 0; 1911 int last_type = 0;
1910 for (size_t i = 0; i < count; ++i) { 1912 for (size_t i = 0; i < count; ++i) {
1911 unsigned int mapped_id = GetMappedTouch(points[i].dwID); 1913 unsigned int mapped_id = GetMappedTouch(points[i].dwID);
1912 1914
1913 WebKit::WebTouchPoint* point = NULL; 1915 WebKit::WebTouchPoint* point = NULL;
1914 for (unsigned j = 0; j < touch_event_.touchesLength; ++j) { 1916 for (unsigned j = 0; j < touch_event_.touchesLength; ++j) {
1915 if (static_cast<DWORD>(touch_event_.touches[j].id) == mapped_id) { 1917 if (static_cast<DWORD>(touch_event_.touches[j].id) == mapped_id) {
1916 point = &touch_event_.touches[j]; 1918 point = &touch_event_.touches[j];
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 //////////////////////////////////////////////////////////////////////////////// 2982 ////////////////////////////////////////////////////////////////////////////////
2981 // RenderWidgetHostView, public: 2983 // RenderWidgetHostView, public:
2982 2984
2983 // static 2985 // static
2984 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( 2986 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
2985 RenderWidgetHost* widget) { 2987 RenderWidgetHost* widget) {
2986 return new RenderWidgetHostViewWin(widget); 2988 return new RenderWidgetHostViewWin(widget);
2987 } 2989 }
2988 2990
2989 } // namespace content 2991 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698