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

Unified Diff: views/touchui/gesture_manager.cc

Issue 8568022: views: Move desktop and touchui directories to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/touchui/gesture_manager.h ('k') | views/touchui/touch_selection_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/touchui/gesture_manager.cc
diff --git a/views/touchui/gesture_manager.cc b/views/touchui/gesture_manager.cc
deleted file mode 100644
index 0ffc1e52ebb98db938645506cb65612ea7d7ed4d..0000000000000000000000000000000000000000
--- a/views/touchui/gesture_manager.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "views/touchui/gesture_manager.h"
-#ifndef NDEBUG
-#include <ostream>
-#endif
-
-#include "base/logging.h"
-#include "views/events/event.h"
-#include "views/view.h"
-#include "views/views_delegate.h"
-#include "views/widget/widget.h"
-
-namespace views {
-
-GestureManager::~GestureManager() {
-}
-
-GestureManager* GestureManager::GetInstance() {
- return Singleton<GestureManager>::get();
-}
-
-bool GestureManager::ProcessTouchEventForGesture(const TouchEvent& event,
- View* source,
- ui::TouchStatus status) {
- if (status != ui::TOUCH_STATUS_UNKNOWN)
- return false; // The event was consumed by a touch sequence.
-
- // TODO(rjkroege): A realistic version of the GestureManager will
- // appear in a subsequent CL. This interim version permits verifying that the
- // event distribution code works by turning all touch inputs into
- // mouse approximations.
-
- // Conver the touch-event into a mouse-event. This mouse-event gets its
- // 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);
- } 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);
- }
- }
- return true;
-}
-
-GestureManager::GestureManager() {
-}
-
-} // namespace views
« no previous file with comments | « views/touchui/gesture_manager.h ('k') | views/touchui/touch_selection_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698