| 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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 | 1118 |
| 1119 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { | 1119 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { |
| 1120 return scoped_ptr<ui::EventTargetIterator>( | 1120 return scoped_ptr<ui::EventTargetIterator>( |
| 1121 new ui::EventTargetIteratorImpl<View>(children_)); | 1121 new ui::EventTargetIteratorImpl<View>(children_)); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 ui::EventTargeter* View::GetEventTargeter() { | 1124 ui::EventTargeter* View::GetEventTargeter() { |
| 1125 return targeter_.get(); | 1125 return targeter_.get(); |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 const ui::EventTargeter* View::GetEventTargeter() const { | |
| 1129 return targeter_.get(); | |
| 1130 } | |
| 1131 | |
| 1132 void View::ConvertEventToTarget(ui::EventTarget* target, | 1128 void View::ConvertEventToTarget(ui::EventTarget* target, |
| 1133 ui::LocatedEvent* event) { | 1129 ui::LocatedEvent* event) { |
| 1134 event->ConvertLocationToTarget(this, static_cast<View*>(target)); | 1130 event->ConvertLocationToTarget(this, static_cast<View*>(target)); |
| 1135 } | 1131 } |
| 1136 | 1132 |
| 1137 // Accelerators ---------------------------------------------------------------- | 1133 // Accelerators ---------------------------------------------------------------- |
| 1138 | 1134 |
| 1139 void View::AddAccelerator(const ui::Accelerator& accelerator) { | 1135 void View::AddAccelerator(const ui::Accelerator& accelerator) { |
| 1140 if (!accelerators_.get()) | 1136 if (!accelerators_.get()) |
| 1141 accelerators_.reset(new std::vector<ui::Accelerator>()); | 1137 accelerators_.reset(new std::vector<ui::Accelerator>()); |
| (...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 // Message the RootView to do the drag and drop. That way if we're removed | 2494 // Message the RootView to do the drag and drop. That way if we're removed |
| 2499 // the RootView can detect it and avoid calling us back. | 2495 // the RootView can detect it and avoid calling us back. |
| 2500 gfx::Point widget_location(event.location()); | 2496 gfx::Point widget_location(event.location()); |
| 2501 ConvertPointToWidget(this, &widget_location); | 2497 ConvertPointToWidget(this, &widget_location); |
| 2502 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2498 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2503 // WARNING: we may have been deleted. | 2499 // WARNING: we may have been deleted. |
| 2504 return true; | 2500 return true; |
| 2505 } | 2501 } |
| 2506 | 2502 |
| 2507 } // namespace views | 2503 } // namespace views |
| OLD | NEW |