| 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
| 6 | 6 |
| 7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 | 1045 |
| 1046 bool View::CanAcceptEvent(const ui::Event& event) { | 1046 bool View::CanAcceptEvent(const ui::Event& event) { |
| 1047 return IsDrawn(); | 1047 return IsDrawn(); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 ui::EventTarget* View::GetParentTarget() { | 1050 ui::EventTarget* View::GetParentTarget() { |
| 1051 return parent_; | 1051 return parent_; |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { | 1054 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { |
| 1055 return scoped_ptr<ui::EventTargetIterator>( | 1055 return make_scoped_ptr(new ui::EventTargetIteratorImpl<View>(children_)); |
| 1056 new ui::EventTargetIteratorImpl<View>(children_)); | |
| 1057 } | 1056 } |
| 1058 | 1057 |
| 1059 ui::EventTargeter* View::GetEventTargeter() { | 1058 ui::EventTargeter* View::GetEventTargeter() { |
| 1060 return targeter_.get(); | 1059 return targeter_.get(); |
| 1061 } | 1060 } |
| 1062 | 1061 |
| 1063 void View::ConvertEventToTarget(ui::EventTarget* target, | 1062 void View::ConvertEventToTarget(ui::EventTarget* target, |
| 1064 ui::LocatedEvent* event) { | 1063 ui::LocatedEvent* event) { |
| 1065 event->ConvertLocationToTarget(this, static_cast<View*>(target)); | 1064 event->ConvertLocationToTarget(this, static_cast<View*>(target)); |
| 1066 } | 1065 } |
| (...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2452 // Message the RootView to do the drag and drop. That way if we're removed | 2451 // Message the RootView to do the drag and drop. That way if we're removed |
| 2453 // the RootView can detect it and avoid calling us back. | 2452 // the RootView can detect it and avoid calling us back. |
| 2454 gfx::Point widget_location(event.location()); | 2453 gfx::Point widget_location(event.location()); |
| 2455 ConvertPointToWidget(this, &widget_location); | 2454 ConvertPointToWidget(this, &widget_location); |
| 2456 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2455 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2457 // WARNING: we may have been deleted. | 2456 // WARNING: we may have been deleted. |
| 2458 return true; | 2457 return true; |
| 2459 } | 2458 } |
| 2460 | 2459 |
| 2461 } // namespace views | 2460 } // namespace views |
| OLD | NEW |