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

Side by Side Diff: views/view.cc

Issue 8364039: Initial views touchui GestureRecognizer support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added gesture tests in view_unittest 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/view.h" 5 #include "views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 } 768 }
769 769
770 void View::OnMouseExited(const MouseEvent& event) { 770 void View::OnMouseExited(const MouseEvent& event) {
771 } 771 }
772 772
773 ui::TouchStatus View::OnTouchEvent(const TouchEvent& event) { 773 ui::TouchStatus View::OnTouchEvent(const TouchEvent& event) {
774 DVLOG(1) << "visited the OnTouchEvent"; 774 DVLOG(1) << "visited the OnTouchEvent";
775 return ui::TOUCH_STATUS_UNKNOWN; 775 return ui::TOUCH_STATUS_UNKNOWN;
776 } 776 }
777 777
778 ui::GestureStatus View::OnGestureEvent(const GestureEvent& event) {
779 DVLOG(1) << "visited the OnGestureEvent";
780 return ui::GESTURE_STATUS_UNKNOWN;
781 }
782
778 void View::SetMouseHandler(View *new_mouse_handler) { 783 void View::SetMouseHandler(View *new_mouse_handler) {
779 // It is valid for new_mouse_handler to be NULL 784 // It is valid for new_mouse_handler to be NULL
780 if (parent_) 785 if (parent_)
781 parent_->SetMouseHandler(new_mouse_handler); 786 parent_->SetMouseHandler(new_mouse_handler);
782 } 787 }
783 788
784 bool View::OnKeyPressed(const KeyEvent& event) { 789 bool View::OnKeyPressed(const KeyEvent& event) {
785 return false; 790 return false;
786 } 791 }
787 792
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 } 1927 }
1923 // WARNING: we may have been deleted. 1928 // WARNING: we may have been deleted.
1924 } 1929 }
1925 1930
1926 ui::TouchStatus View::ProcessTouchEvent(const TouchEvent& event) { 1931 ui::TouchStatus View::ProcessTouchEvent(const TouchEvent& event) {
1927 // TODO(rjkroege): Implement a grab scheme similar to as as is found in 1932 // TODO(rjkroege): Implement a grab scheme similar to as as is found in
1928 // MousePressed. 1933 // MousePressed.
1929 return OnTouchEvent(event); 1934 return OnTouchEvent(event);
1930 } 1935 }
1931 1936
1937 ui::GestureStatus View::ProcessGestureEvent(const GestureEvent& event) {
1938 // TODO(Gajen): Implement a grab scheme similar to as as is found in
1939 // MousePressed.
1940 return OnGestureEvent(event);
1941 }
1942
1932 // Accelerators ---------------------------------------------------------------- 1943 // Accelerators ----------------------------------------------------------------
1933 1944
1934 void View::RegisterPendingAccelerators() { 1945 void View::RegisterPendingAccelerators() {
1935 if (!accelerators_.get() || 1946 if (!accelerators_.get() ||
1936 registered_accelerator_count_ == accelerators_->size()) { 1947 registered_accelerator_count_ == accelerators_->size()) {
1937 // No accelerators are waiting for registration. 1948 // No accelerators are waiting for registration.
1938 return; 1949 return;
1939 } 1950 }
1940 1951
1941 if (!GetWidget()) { 1952 if (!GetWidget()) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 2078
2068 OSExchangeData data; 2079 OSExchangeData data;
2069 WriteDragData(press_pt, &data); 2080 WriteDragData(press_pt, &data);
2070 2081
2071 // Message the RootView to do the drag and drop. That way if we're removed 2082 // Message the RootView to do the drag and drop. That way if we're removed
2072 // the RootView can detect it and avoid calling us back. 2083 // the RootView can detect it and avoid calling us back.
2073 GetWidget()->RunShellDrag(this, data, drag_operations); 2084 GetWidget()->RunShellDrag(this, data, drag_operations);
2074 } 2085 }
2075 2086
2076 } // namespace views 2087 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698