| 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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 | 1110 |
| 1111 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { | 1111 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { |
| 1112 return scoped_ptr<ui::EventTargetIterator>( | 1112 return scoped_ptr<ui::EventTargetIterator>( |
| 1113 new ui::EventTargetIteratorImpl<View>(children_)); | 1113 new ui::EventTargetIteratorImpl<View>(children_)); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 ui::EventTargeter* View::GetEventTargeter() { | 1116 ui::EventTargeter* View::GetEventTargeter() { |
| 1117 return targeter_.get(); | 1117 return targeter_.get(); |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 const ui::EventTargeter* View::GetEventTargeter() const { |
| 1121 return targeter_.get(); |
| 1122 } |
| 1123 |
| 1120 void View::ConvertEventToTarget(ui::EventTarget* target, | 1124 void View::ConvertEventToTarget(ui::EventTarget* target, |
| 1121 ui::LocatedEvent* event) { | 1125 ui::LocatedEvent* event) { |
| 1122 event->ConvertLocationToTarget(this, static_cast<View*>(target)); | 1126 event->ConvertLocationToTarget(this, static_cast<View*>(target)); |
| 1123 } | 1127 } |
| 1124 | 1128 |
| 1125 // Accelerators ---------------------------------------------------------------- | 1129 // Accelerators ---------------------------------------------------------------- |
| 1126 | 1130 |
| 1127 void View::AddAccelerator(const ui::Accelerator& accelerator) { | 1131 void View::AddAccelerator(const ui::Accelerator& accelerator) { |
| 1128 if (!accelerators_.get()) | 1132 if (!accelerators_.get()) |
| 1129 accelerators_.reset(new std::vector<ui::Accelerator>()); | 1133 accelerators_.reset(new std::vector<ui::Accelerator>()); |
| (...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 // Message the RootView to do the drag and drop. That way if we're removed | 2490 // Message the RootView to do the drag and drop. That way if we're removed |
| 2487 // the RootView can detect it and avoid calling us back. | 2491 // the RootView can detect it and avoid calling us back. |
| 2488 gfx::Point widget_location(event.location()); | 2492 gfx::Point widget_location(event.location()); |
| 2489 ConvertPointToWidget(this, &widget_location); | 2493 ConvertPointToWidget(this, &widget_location); |
| 2490 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2494 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2491 // WARNING: we may have been deleted. | 2495 // WARNING: we may have been deleted. |
| 2492 return true; | 2496 return true; |
| 2493 } | 2497 } |
| 2494 | 2498 |
| 2495 } // namespace views | 2499 } // namespace views |
| OLD | NEW |