Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: aura/event.cc

Issue 7739002: Revert 98850 - Proper MouseEvent targeting. Adds a Window method that locates a Window for a give... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « aura/event.h ('k') | aura/root_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #include "aura/event.h" 5 #include "aura/event.h"
6 6
7 #include "aura/window.h"
8
9 namespace aura { 7 namespace aura {
10 8
11 Event::Event(ui::EventType type, int flags) 9 Event::Event(ui::EventType type, int flags)
12 : type_(type), 10 : type_(type),
13 time_stamp_(base::Time::NowFromSystemTime()), 11 time_stamp_(base::Time::NowFromSystemTime()),
14 flags_(flags) { 12 flags_(flags) {
15 Init(); 13 Init();
16 } 14 }
17 15
18 Event::Event(NativeEvent native_event, ui::EventType type, int flags) 16 Event::Event(NativeEvent native_event, ui::EventType type, int flags)
19 : type_(type), 17 : type_(type),
20 time_stamp_(base::Time::NowFromSystemTime()), 18 time_stamp_(base::Time::NowFromSystemTime()),
21 flags_(flags) { 19 flags_(flags) {
22 InitWithNativeEvent(native_event); 20 InitWithNativeEvent(native_event);
23 } 21 }
24 22
25 Event::Event(const Event& copy) 23 Event::Event(const Event& copy)
26 : native_event_(copy.native_event_), 24 : native_event_(copy.native_event_),
27 type_(copy.type_), 25 type_(copy.type_),
28 time_stamp_(copy.time_stamp_), 26 time_stamp_(copy.time_stamp_),
29 flags_(copy.flags_) { 27 flags_(copy.flags_) {
30 } 28 }
31 29
32 LocatedEvent::LocatedEvent(const LocatedEvent& model,
33 Window* source,
34 Window* target)
35 : Event(model),
36 location_(model.location_) {
37 if (target && target != source)
38 Window::ConvertPointToWindow(source, target, &location_);
39 }
40
41 MouseEvent::MouseEvent(const MouseEvent& model, Window* source, Window* target)
42 : LocatedEvent(model, source, target) {
43 }
44
45 } // namespace aura 30 } // namespace aura
46 31
OLDNEW
« no previous file with comments | « aura/event.h ('k') | aura/root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698