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

Side by Side Diff: ui/views/view.cc

Issue 9076002: Initial views touchui Gesture Recognizer support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win release build Created 8 years, 11 months 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
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/view.h" 5 #include "ui/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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 786 }
787 787
788 void View::OnMouseExited(const MouseEvent& event) { 788 void View::OnMouseExited(const MouseEvent& event) {
789 } 789 }
790 790
791 ui::TouchStatus View::OnTouchEvent(const TouchEvent& event) { 791 ui::TouchStatus View::OnTouchEvent(const TouchEvent& event) {
792 DVLOG(1) << "visited the OnTouchEvent"; 792 DVLOG(1) << "visited the OnTouchEvent";
793 return ui::TOUCH_STATUS_UNKNOWN; 793 return ui::TOUCH_STATUS_UNKNOWN;
794 } 794 }
795 795
796 ui::GestureStatus View::OnGestureEvent(const GestureEvent& event) {
797 return ui::GESTURE_STATUS_UNKNOWN;
798 }
799
796 void View::SetMouseHandler(View *new_mouse_handler) { 800 void View::SetMouseHandler(View *new_mouse_handler) {
797 // It is valid for new_mouse_handler to be NULL 801 // It is valid for new_mouse_handler to be NULL
798 if (parent_) 802 if (parent_)
799 parent_->SetMouseHandler(new_mouse_handler); 803 parent_->SetMouseHandler(new_mouse_handler);
800 } 804 }
801 805
802 bool View::OnKeyPressed(const KeyEvent& event) { 806 bool View::OnKeyPressed(const KeyEvent& event) {
803 return false; 807 return false;
804 } 808 }
805 809
806 bool View::OnKeyReleased(const KeyEvent& event) { 810 bool View::OnKeyReleased(const KeyEvent& event) {
807 return false; 811 return false;
808 } 812 }
809 813
810 bool View::OnMouseWheel(const MouseWheelEvent& event) { 814 bool View::OnMouseWheel(const MouseWheelEvent& event) {
811 return false; 815 return false;
812 } 816 }
813 817
814 ui::TextInputClient* View::GetTextInputClient() { 818 ui::TextInputClient* View::GetTextInputClient() {
815 return NULL; 819 return NULL;
816 } 820 }
817 821
818 InputMethod* View::GetInputMethod() { 822 InputMethod* View::GetInputMethod() {
819 Widget* widget = GetWidget(); 823 Widget* widget = GetWidget();
820 return widget ? widget->GetInputMethod() : NULL; 824 return widget ? widget->GetInputMethod() : NULL;
821 } 825 }
822 826
827 ui::GestureStatus View::ProcessGestureEvent(const GestureEvent& event) {
828 // TODO(Gajen): Implement a grab scheme similar to as as is found in
829 // MousePressed.
830 return OnGestureEvent(event);
831 }
832
823 // Accelerators ---------------------------------------------------------------- 833 // Accelerators ----------------------------------------------------------------
824 834
825 void View::AddAccelerator(const ui::Accelerator& accelerator) { 835 void View::AddAccelerator(const ui::Accelerator& accelerator) {
826 if (!accelerators_.get()) 836 if (!accelerators_.get())
827 accelerators_.reset(new std::vector<ui::Accelerator>()); 837 accelerators_.reset(new std::vector<ui::Accelerator>());
828 838
829 DCHECK(std::find(accelerators_->begin(), accelerators_->end(), accelerator) == 839 DCHECK(std::find(accelerators_->begin(), accelerators_->end(), accelerator) ==
830 accelerators_->end()) 840 accelerators_->end())
831 << "Registering the same accelerator multiple times"; 841 << "Registering the same accelerator multiple times";
832 842
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 2045
2036 OSExchangeData data; 2046 OSExchangeData data;
2037 WriteDragData(press_pt, &data); 2047 WriteDragData(press_pt, &data);
2038 2048
2039 // Message the RootView to do the drag and drop. That way if we're removed 2049 // Message the RootView to do the drag and drop. That way if we're removed
2040 // the RootView can detect it and avoid calling us back. 2050 // the RootView can detect it and avoid calling us back.
2041 GetWidget()->RunShellDrag(this, data, drag_operations); 2051 GetWidget()->RunShellDrag(this, data, drag_operations);
2042 } 2052 }
2043 2053
2044 } // namespace views 2054 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698