OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/events/event.h" |
| 6 |
| 7 #include "ui/views/view.h" |
| 8 |
| 9 namespace ui { |
| 10 |
| 11 //////////////////////////////////////////////////////////////////////////////// |
| 12 // Event, protected: |
| 13 |
| 14 Event::Event(EventType type, int flags) |
| 15 : type_(type), |
| 16 flags_(flags) { |
| 17 } |
| 18 |
| 19 //////////////////////////////////////////////////////////////////////////////// |
| 20 // LocatedEvent, protected: |
| 21 |
| 22 LocatedEvent::LocatedEvent(EventType type, |
| 23 const gfx::Point& location, |
| 24 int flags) |
| 25 : Event(type, flags), |
| 26 location_(location) { |
| 27 } |
| 28 |
| 29 LocatedEvent::LocatedEvent(const LocatedEvent& other, |
| 30 View* source, |
| 31 View* target) |
| 32 : Event(other.type(), other.flags()) { |
| 33 location_ = other.location(); |
| 34 View::ConvertPointToView(source, target, &location_); |
| 35 } |
| 36 |
| 37 //////////////////////////////////////////////////////////////////////////////// |
| 38 // MouseEvent, public: |
| 39 |
| 40 MouseEvent::MouseEvent(const MouseEvent& other, View* source, View* target) |
| 41 : LocatedEvent(other, source, target) { |
| 42 } |
| 43 |
| 44 } // namespace views |
OLD | NEW |