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

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: Event injection as per Robert comments 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 } 783 }
784 784
785 void View::OnMouseExited(const MouseEvent& event) { 785 void View::OnMouseExited(const MouseEvent& event) {
786 } 786 }
787 787
788 ui::TouchStatus View::OnTouchEvent(const TouchEvent& event) { 788 ui::TouchStatus View::OnTouchEvent(const TouchEvent& event) {
789 DVLOG(1) << "visited the OnTouchEvent"; 789 DVLOG(1) << "visited the OnTouchEvent";
790 return ui::TOUCH_STATUS_UNKNOWN; 790 return ui::TOUCH_STATUS_UNKNOWN;
791 } 791 }
792 792
793 bool View::OnGestureEvent(const GestureEvent& event) {
794 DVLOG(1) << "visited the OnGestureEvent";
795 return false;
796 }
797
793 void View::SetMouseHandler(View *new_mouse_handler) { 798 void View::SetMouseHandler(View *new_mouse_handler) {
794 // It is valid for new_mouse_handler to be NULL 799 // It is valid for new_mouse_handler to be NULL
795 if (parent_) 800 if (parent_)
796 parent_->SetMouseHandler(new_mouse_handler); 801 parent_->SetMouseHandler(new_mouse_handler);
797 } 802 }
798 803
799 bool View::OnKeyPressed(const KeyEvent& event) { 804 bool View::OnKeyPressed(const KeyEvent& event) {
800 return false; 805 return false;
801 } 806 }
802 807
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 } 1932 }
1928 // WARNING: we may have been deleted. 1933 // WARNING: we may have been deleted.
1929 } 1934 }
1930 1935
1931 ui::TouchStatus View::ProcessTouchEvent(const TouchEvent& event) { 1936 ui::TouchStatus View::ProcessTouchEvent(const TouchEvent& event) {
1932 // TODO(rjkroege): Implement a grab scheme similar to as as is found in 1937 // TODO(rjkroege): Implement a grab scheme similar to as as is found in
1933 // MousePressed. 1938 // MousePressed.
1934 return OnTouchEvent(event); 1939 return OnTouchEvent(event);
1935 } 1940 }
1936 1941
1942 bool View::ProcessTouchEvent(const TouchEvent& event) {
1943 // TODO(Gajen): Implement a grab scheme similar to as as is found in
1944 // MousePressed.
rjkroege 2011/10/24 17:41:09 bad indent
Gajen 2011/10/25 14:32:29 Done.
1945 return OnGestureEvent(event);
1946 }
1947
1937 // Accelerators ---------------------------------------------------------------- 1948 // Accelerators ----------------------------------------------------------------
1938 1949
1939 void View::RegisterPendingAccelerators() { 1950 void View::RegisterPendingAccelerators() {
1940 if (!accelerators_.get() || 1951 if (!accelerators_.get() ||
1941 registered_accelerator_count_ == accelerators_->size()) { 1952 registered_accelerator_count_ == accelerators_->size()) {
1942 // No accelerators are waiting for registration. 1953 // No accelerators are waiting for registration.
1943 return; 1954 return;
1944 } 1955 }
1945 1956
1946 if (!GetWidget()) { 1957 if (!GetWidget()) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 2083
2073 OSExchangeData data; 2084 OSExchangeData data;
2074 WriteDragData(press_pt, &data); 2085 WriteDragData(press_pt, &data);
2075 2086
2076 // Message the RootView to do the drag and drop. That way if we're removed 2087 // Message the RootView to do the drag and drop. That way if we're removed
2077 // the RootView can detect it and avoid calling us back. 2088 // the RootView can detect it and avoid calling us back.
2078 GetWidget()->RunShellDrag(this, data, drag_operations); 2089 GetWidget()->RunShellDrag(this, data, drag_operations);
2079 } 2090 }
2080 2091
2081 } // namespace views 2092 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698