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