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/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 host_->ForwardTouchEvent(touch_event_); | 727 host_->ForwardTouchEvent(touch_event_); |
| 728 | 728 |
| 729 // 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. |
| 730 if (e.GetType() == views::Event::ET_TOUCH_RELEASED) { | 730 if (e.GetType() == views::Event::ET_TOUCH_RELEASED) { |
| 731 --touch_event_.touchPointsLength; | 731 --touch_event_.touchPointsLength; |
| 732 for (int i = point - touch_event_.touchPoints; | 732 for (int i = point - touch_event_.touchPoints; |
| 733 i < touch_event_.touchPointsLength; | 733 i < touch_event_.touchPointsLength; |
| 734 ++i) { | 734 ++i) { |
| 735 touch_event_.touchPoints[i] = touch_event_.touchPoints[i + 1]; | 735 touch_event_.touchPoints[i] = touch_event_.touchPoints[i + 1]; |
| 736 } | 736 } |
| 737 | |
| 738 if (touch_event_.touchPointsLength == 0) { | |
|
sky
2011/01/14 21:47:20
This pattern is much different from how we've typi
sadrul
2011/01/14 22:11:33
I think you mean that the RootView, or the Acceler
| |
| 739 // A touch sequence has completely ended. Notify the observer. | |
| 740 if (touch_event_observer_) { | |
| 741 touch_event_observer_->OnTouchSequenceEnd(); | |
| 742 } | |
| 743 } | |
| 737 } | 744 } |
| 738 | 745 |
| 739 return true; | 746 return true; |
| 740 } | 747 } |
| 741 | 748 |
| 742 // static | 749 // static |
| 743 RenderWidgetHostView* | 750 RenderWidgetHostView* |
| 744 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 751 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 745 gfx::NativeView widget) { | 752 gfx::NativeView widget) { |
| 746 gpointer user_data = g_object_get_data(G_OBJECT(widget), | 753 gpointer user_data = g_object_get_data(G_OBJECT(widget), |
| 747 kRenderWidgetHostViewKey); | 754 kRenderWidgetHostViewKey); |
| 748 return reinterpret_cast<RenderWidgetHostView*>(user_data); | 755 return reinterpret_cast<RenderWidgetHostView*>(user_data); |
| 749 } | 756 } |
| OLD | NEW |