Chromium Code Reviews| 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/keyboard_code_conversion_gtk.h" | 10 #include "app/keyboard_code_conversion_gtk.h" |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 714 // Mark the rest of the points as stationary. | 714 // Mark the rest of the points as stationary. |
| 715 for (int i = 0; i < touch_event_.touchPointsLength; ++i) { | 715 for (int i = 0; i < touch_event_.touchPointsLength; ++i) { |
| 716 WebKit::WebTouchPoint* iter = touch_event_.touchPoints + i; | 716 WebKit::WebTouchPoint* iter = touch_event_.touchPoints + i; |
| 717 if (iter != point) { | 717 if (iter != point) { |
| 718 iter->state = WebKit::WebTouchPoint::StateStationary; | 718 iter->state = WebKit::WebTouchPoint::StateStationary; |
| 719 } | 719 } |
| 720 } | 720 } |
| 721 | 721 |
| 722 // Update the type of the touch event. | 722 // Update the type of the touch event. |
| 723 touch_event_.type = TouchEventTypeFromEvent(&e); | 723 touch_event_.type = TouchEventTypeFromEvent(&e); |
| 724 touch_event_.timeStampSeconds = base::Time::Now().ToDoubleT(); | |
|
rjkroege
2011/01/12 19:06:26
I would prefer if you used the time from the origi
sadrul
2011/01/12 19:44:55
At the moment, this doesn't work, since |views::Ev
| |
| 724 | 725 |
| 725 // The event and all the touches have been updated. Dispatch. | 726 // The event and all the touches have been updated. Dispatch. |
| 726 host_->ForwardTouchEvent(touch_event_); | 727 host_->ForwardTouchEvent(touch_event_); |
| 727 | 728 |
| 728 // If the touch was released, then remove it from the list of touch points. | 729 // If the touch was released, then remove it from the list of touch points. |
| 729 if (e.GetType() == views::Event::ET_TOUCH_RELEASED) { | 730 if (e.GetType() == views::Event::ET_TOUCH_RELEASED) { |
| 730 --touch_event_.touchPointsLength; | 731 --touch_event_.touchPointsLength; |
| 731 for (int i = point - touch_event_.touchPoints; | 732 for (int i = point - touch_event_.touchPoints; |
| 732 i < touch_event_.touchPointsLength; | 733 i < touch_event_.touchPointsLength; |
| 733 ++i) { | 734 ++i) { |
| 734 touch_event_.touchPoints[i] = touch_event_.touchPoints[i + 1]; | 735 touch_event_.touchPoints[i] = touch_event_.touchPoints[i + 1]; |
| 735 } | 736 } |
| 736 } | 737 } |
| 737 | 738 |
| 738 return true; | 739 return true; |
| 739 } | 740 } |
| 740 | 741 |
| 741 // static | 742 // static |
| 742 RenderWidgetHostView* | 743 RenderWidgetHostView* |
| 743 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 744 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 744 gfx::NativeView widget) { | 745 gfx::NativeView widget) { |
| 745 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 746 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
| 746 kRenderWidgetHostViewKey); | 747 kRenderWidgetHostViewKey); |
| 747 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 748 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
| 748 } | 749 } |
| OLD | NEW |