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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1159 | 1159 |
1160 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { | 1160 scoped_ptr<ui::EventTargetIterator> View::GetChildIterator() const { |
1161 return scoped_ptr<ui::EventTargetIterator>( | 1161 return scoped_ptr<ui::EventTargetIterator>( |
1162 new ui::EventTargetIteratorImpl<View>(children_)); | 1162 new ui::EventTargetIteratorImpl<View>(children_)); |
1163 } | 1163 } |
1164 | 1164 |
1165 ui::EventTargeter* View::GetEventTargeter() { | 1165 ui::EventTargeter* View::GetEventTargeter() { |
1166 return targeter_.get(); | 1166 return targeter_.get(); |
1167 } | 1167 } |
1168 | 1168 |
1169 ui::EventTargeter* View::GetEventTargeter() const { | |
1170 return targeter_.get(); | |
tdanderson
2014/05/27 16:33:33
Added this seemingly necessary witchcraft for spee
| |
1171 } | |
1172 | |
1169 void View::ConvertEventToTarget(ui::EventTarget* target, | 1173 void View::ConvertEventToTarget(ui::EventTarget* target, |
1170 ui::LocatedEvent* event) { | 1174 ui::LocatedEvent* event) { |
1171 event->ConvertLocationToTarget(this, static_cast<View*>(target)); | 1175 event->ConvertLocationToTarget(this, static_cast<View*>(target)); |
1172 } | 1176 } |
1173 | 1177 |
1174 // Accelerators ---------------------------------------------------------------- | 1178 // Accelerators ---------------------------------------------------------------- |
1175 | 1179 |
1176 void View::AddAccelerator(const ui::Accelerator& accelerator) { | 1180 void View::AddAccelerator(const ui::Accelerator& accelerator) { |
1177 if (!accelerators_.get()) | 1181 if (!accelerators_.get()) |
1178 accelerators_.reset(new std::vector<ui::Accelerator>()); | 1182 accelerators_.reset(new std::vector<ui::Accelerator>()); |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2535 // Message the RootView to do the drag and drop. That way if we're removed | 2539 // Message the RootView to do the drag and drop. That way if we're removed |
2536 // the RootView can detect it and avoid calling us back. | 2540 // the RootView can detect it and avoid calling us back. |
2537 gfx::Point widget_location(event.location()); | 2541 gfx::Point widget_location(event.location()); |
2538 ConvertPointToWidget(this, &widget_location); | 2542 ConvertPointToWidget(this, &widget_location); |
2539 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2543 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2540 // WARNING: we may have been deleted. | 2544 // WARNING: we may have been deleted. |
2541 return true; | 2545 return true; |
2542 } | 2546 } |
2543 | 2547 |
2544 } // namespace views | 2548 } // namespace views |
OLD | NEW |