| OLD | NEW |
| 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 void View::OnMouseEntered(const ui::MouseEvent& event) { | 822 void View::OnMouseEntered(const ui::MouseEvent& event) { |
| 823 } | 823 } |
| 824 | 824 |
| 825 void View::OnMouseExited(const ui::MouseEvent& event) { | 825 void View::OnMouseExited(const ui::MouseEvent& event) { |
| 826 } | 826 } |
| 827 | 827 |
| 828 ui::TouchStatus View::OnTouchEvent(const ui::TouchEvent& event) { | 828 ui::TouchStatus View::OnTouchEvent(const ui::TouchEvent& event) { |
| 829 return ui::TOUCH_STATUS_UNKNOWN; | 829 return ui::TOUCH_STATUS_UNKNOWN; |
| 830 } | 830 } |
| 831 | 831 |
| 832 ui::GestureStatus View::OnGestureEvent(const ui::GestureEvent& event) { | 832 ui::EventResult View::OnGestureEvent(const ui::GestureEvent& event) { |
| 833 return ui::GESTURE_STATUS_UNKNOWN; | 833 return ui::ER_UNHANDLED; |
| 834 } | 834 } |
| 835 | 835 |
| 836 void View::SetMouseHandler(View* new_mouse_handler) { | 836 void View::SetMouseHandler(View* new_mouse_handler) { |
| 837 // |new_mouse_handler| may be NULL. | 837 // |new_mouse_handler| may be NULL. |
| 838 if (parent_) | 838 if (parent_) |
| 839 parent_->SetMouseHandler(new_mouse_handler); | 839 parent_->SetMouseHandler(new_mouse_handler); |
| 840 } | 840 } |
| 841 | 841 |
| 842 bool View::OnKeyPressed(const ui::KeyEvent& event) { | 842 bool View::OnKeyPressed(const ui::KeyEvent& event) { |
| 843 return false; | 843 return false; |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1958 } | 1958 } |
| 1959 // WARNING: we may have been deleted. | 1959 // WARNING: we may have been deleted. |
| 1960 } | 1960 } |
| 1961 | 1961 |
| 1962 ui::TouchStatus View::ProcessTouchEvent(const ui::TouchEvent& event) { | 1962 ui::TouchStatus View::ProcessTouchEvent(const ui::TouchEvent& event) { |
| 1963 // TODO(rjkroege): Implement a grab scheme similar to as as is found in | 1963 // TODO(rjkroege): Implement a grab scheme similar to as as is found in |
| 1964 // MousePressed. | 1964 // MousePressed. |
| 1965 return OnTouchEvent(event); | 1965 return OnTouchEvent(event); |
| 1966 } | 1966 } |
| 1967 | 1967 |
| 1968 ui::GestureStatus View::ProcessGestureEvent(const ui::GestureEvent& event) { | 1968 ui::EventResult View::ProcessGestureEvent(const ui::GestureEvent& event) { |
| 1969 if (context_menu_controller_ && | 1969 if (context_menu_controller_ && |
| 1970 (event.type() == ui::ET_GESTURE_LONG_PRESS || | 1970 (event.type() == ui::ET_GESTURE_LONG_PRESS || |
| 1971 event.type() == ui::ET_GESTURE_TWO_FINGER_TAP)) { | 1971 event.type() == ui::ET_GESTURE_TWO_FINGER_TAP)) { |
| 1972 gfx::Point location(event.location()); | 1972 gfx::Point location(event.location()); |
| 1973 ConvertPointToScreen(this, &location); | 1973 ConvertPointToScreen(this, &location); |
| 1974 ShowContextMenu(location, true); | 1974 ShowContextMenu(location, true); |
| 1975 return ui::GESTURE_STATUS_CONSUMED; | 1975 return ui::ER_CONSUMED; |
| 1976 } | 1976 } |
| 1977 return OnGestureEvent(event); | 1977 return OnGestureEvent(event); |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 // Accelerators ---------------------------------------------------------------- | 1980 // Accelerators ---------------------------------------------------------------- |
| 1981 | 1981 |
| 1982 void View::RegisterPendingAccelerators() { | 1982 void View::RegisterPendingAccelerators() { |
| 1983 if (!accelerators_.get() || | 1983 if (!accelerators_.get() || |
| 1984 registered_accelerator_count_ == accelerators_->size()) { | 1984 registered_accelerator_count_ == accelerators_->size()) { |
| 1985 // No accelerators are waiting for registration. | 1985 // No accelerators are waiting for registration. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 gfx::Point widget_location(event.location()); | 2113 gfx::Point widget_location(event.location()); |
| 2114 ConvertPointToWidget(this, &widget_location); | 2114 ConvertPointToWidget(this, &widget_location); |
| 2115 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); | 2115 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); |
| 2116 return true; | 2116 return true; |
| 2117 #else | 2117 #else |
| 2118 return false; | 2118 return false; |
| 2119 #endif // !defined(OS_MACOSX) | 2119 #endif // !defined(OS_MACOSX) |
| 2120 } | 2120 } |
| 2121 | 2121 |
| 2122 } // namespace views | 2122 } // namespace views |
| OLD | NEW |