Index: ui/views/touchui/gesture_manager.cc |
=================================================================== |
--- ui/views/touchui/gesture_manager.cc (revision 110826) |
+++ ui/views/touchui/gesture_manager.cc (working copy) |
@@ -11,7 +11,6 @@ |
#include "base/logging.h" |
#include "ui/views/events/event.h" |
#include "views/view.h" |
-#include "views/views_delegate.h" |
#include "views/widget/widget.h" |
namespace views { |
@@ -38,28 +37,17 @@ |
// location information from the native-event, so it needs to convert the |
// coordinate to the target widget. |
MouseEvent mouseev(event); |
- if (ViewsDelegate::views_delegate->GetDefaultParentView()) { |
- // TODO(oshima): We may need to send the event back through |
- // window manager to handle mouse capture correctly. |
- Widget* desktop = |
- ViewsDelegate::views_delegate->GetDefaultParentView()->GetWidget(); |
- Widget* source_widget = source->GetWidget(); |
- MouseEvent converted( |
- mouseev, desktop->GetRootView(), source_widget->GetRootView()); |
- source_widget->OnMouseEvent(converted); |
+ Widget* source_widget = source->GetWidget(); |
+ Widget* top_widget = source_widget->GetTopLevelWidget(); |
+ if (source_widget != top_widget && top_widget) { |
+ // This is necessary as TYPE_CHILD widget is still NativeWidgetGtk. |
+ // Fix this once TYPE_CHILD is switched to NativeWidgetViews. |
+ MouseEvent converted(mouseev, |
+ top_widget->GetRootView(), |
+ source_widget->GetRootView()); |
+ source_widget->OnMouseEvent(mouseev); |
} else { |
- Widget* source_widget = source->GetWidget(); |
- Widget* top_widget = source_widget->GetTopLevelWidget(); |
- if (source_widget != top_widget && top_widget) { |
- // This is necessary as TYPE_CHILD widget is still NativeWidgetGtk. |
- // Fix this once TYPE_CHILD is switched to NativeWidgetViews. |
- MouseEvent converted(mouseev, |
- top_widget->GetRootView(), |
- source_widget->GetRootView()); |
- source_widget->OnMouseEvent(mouseev); |
- } else { |
- source_widget->OnMouseEvent(mouseev); |
- } |
+ source_widget->OnMouseEvent(mouseev); |
} |
return true; |
} |