| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host_view_views.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 } | 689 } |
| 690 } | 690 } |
| 691 break; | 691 break; |
| 692 case views::Event::ET_TOUCH_RELEASED: | 692 case views::Event::ET_TOUCH_RELEASED: |
| 693 case views::Event::ET_TOUCH_CANCELLED: | 693 case views::Event::ET_TOUCH_CANCELLED: |
| 694 case views::Event::ET_TOUCH_MOVED: { | 694 case views::Event::ET_TOUCH_MOVED: { |
| 695 // The touch point should have been added to the event from an earlier | 695 // The touch point should have been added to the event from an earlier |
| 696 // _PRESSED event. So find that. | 696 // _PRESSED event. So find that. |
| 697 // At the moment, only a maximum of 4 touch-points are allowed. So a | 697 // At the moment, only a maximum of 4 touch-points are allowed. So a |
| 698 // simple loop should be sufficient. | 698 // simple loop should be sufficient. |
| 699 for (int i = 0; i < WebTouchEvent::touchPointsLengthCap; ++i) { | 699 for (int i = 0; i < touch_event_.touchPointsLength; ++i) { |
| 700 point = touch_event_.touchPoints + i; | 700 point = touch_event_.touchPoints + i; |
| 701 if (point->id == e.identity()) { | 701 if (point->id == e.identity()) { |
| 702 break; | 702 break; |
| 703 } | 703 } |
| 704 point = NULL; | 704 point = NULL; |
| 705 } | 705 } |
| 706 break; | 706 break; |
| 707 } | 707 } |
| 708 default: | 708 default: |
| 709 DLOG(WARNING) << "Unknown touch event " << e.GetType(); | 709 DLOG(WARNING) << "Unknown touch event " << e.GetType(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 } | 753 } |
| 754 | 754 |
| 755 // static | 755 // static |
| 756 RenderWidgetHostView* | 756 RenderWidgetHostView* |
| 757 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 757 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 758 gfx::NativeView widget) { | 758 gfx::NativeView widget) { |
| 759 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 759 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
| 760 kRenderWidgetHostViewKey); | 760 kRenderWidgetHostViewKey); |
| 761 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 761 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
| 762 } | 762 } |
| OLD | NEW |