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

Side by Side Diff: chrome/views/event.cc

Issue 115012: Move: drag_drop_types, favicon_size, icon_util, insets, path, message_box_fla... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | « chrome/views/event.h ('k') | chrome/views/view.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/views/event.h" 5 #include "chrome/views/event.h"
6 6
7 #include "chrome/views/view.h" 7 #include "chrome/views/view.h"
8 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
9
10 using WebKit::WebInputEvent;
11 8
12 namespace views { 9 namespace views {
13 10
14 Event::Event(EventType type, int flags) 11 Event::Event(EventType type, int flags)
15 : type_(type), 12 : type_(type),
16 #if defined(OS_WIN) 13 #if defined(OS_WIN)
17 time_stamp_(GetTickCount()), 14 time_stamp_(GetTickCount()),
18 #else 15 #else
19 time_stamp_(0), 16 time_stamp_(0),
20 #endif 17 #endif
21 flags_(flags) { 18 flags_(flags) {
22 } 19 }
23 20
24 // static
25 int Event::ConvertWebInputEventFlags(int web_input_event_flags) {
26 int r = 0;
27 if (web_input_event_flags & WebInputEvent::ShiftKey)
28 r |= EF_SHIFT_DOWN;
29 if (web_input_event_flags & WebInputEvent::ControlKey)
30 r |= EF_CONTROL_DOWN;
31 if (web_input_event_flags & WebInputEvent::AltKey)
32 r |= EF_ALT_DOWN;
33 return r;
34 }
35
36 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to) 21 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to)
37 : Event(model), 22 : Event(model),
38 location_(model.location_) { 23 location_(model.location_) {
39 if (to) 24 if (to)
40 View::ConvertPointToView(from, to, &location_); 25 View::ConvertPointToView(from, to, &location_);
41 } 26 }
42 27
43 MouseEvent::MouseEvent(EventType type, 28 MouseEvent::MouseEvent(EventType type,
44 View* from, 29 View* from,
45 View* to, 30 View* to,
46 const gfx::Point &l, 31 const gfx::Point &l,
47 int flags) 32 int flags)
48 : LocatedEvent(LocatedEvent(type, gfx::Point(l.x(), l.y()), flags), 33 : LocatedEvent(LocatedEvent(type, gfx::Point(l.x(), l.y()), flags),
49 from, 34 from,
50 to) { 35 to) {
51 }; 36 };
52 37
53 MouseEvent::MouseEvent(const MouseEvent& model, View* from, View* to) 38 MouseEvent::MouseEvent(const MouseEvent& model, View* from, View* to)
54 : LocatedEvent(model, from, to) { 39 : LocatedEvent(model, from, to) {
55 } 40 }
56 41
57 } // namespace views 42 } // namespace views
OLDNEW
« no previous file with comments | « chrome/views/event.h ('k') | chrome/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698