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

Unified Diff: views/events/event.cc

Issue 6487002: Add a new constructor to KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: views/events/event.cc
===================================================================
--- views/events/event.cc (revision 74564)
+++ views/events/event.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,12 +8,35 @@
namespace views {
+////////////////////////////////////////////////////////////////////////////////
+// Event, protected:
+
Event::Event(ui::EventType type, int flags)
: type_(type),
time_stamp_(base::Time::NowFromSystemTime()),
flags_(flags) {
+ Init();
}
+Event::Event(NativeEvent native_event, ui::EventType type, int flags)
+ : type_(type),
+ time_stamp_(base::Time::NowFromSystemTime()),
+ flags_(flags) {
+ InitWithNativeEvent(native_event);
+}
+
+Event::Event(NativeEvent2 native_event_2, ui::EventType type, int flags,
+ FromNativeEvent2 from_native)
+ : native_event_2_(native_event_2),
+ type_(type),
+ time_stamp_(base::Time::NowFromSystemTime()),
+ flags_(flags) {
+ InitWithNativeEvent2(native_event_2, from_native);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// LocatedEvent, public:
+
LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to)
: Event(model),
location_(model.location_) {
@@ -21,14 +44,18 @@
View::ConvertPointToView(from, to, &location_);
}
+////////////////////////////////////////////////////////////////////////////////
+// KeyEvent, public:
+
KeyEvent::KeyEvent(ui::EventType type, ui::KeyboardCode key_code,
- int event_flags, int repeat_count, int message_flags)
+ int event_flags)
: Event(type, event_flags),
- key_code_(key_code),
- repeat_count_(repeat_count),
- message_flags_(message_flags) {
+ key_code_(key_code) {
}
+////////////////////////////////////////////////////////////////////////////////
+// MouseEvent, public:
+
MouseEvent::MouseEvent(ui::EventType type,
View* from,
View* to,
@@ -43,6 +70,9 @@
: LocatedEvent(model, from, to) {
}
+////////////////////////////////////////////////////////////////////////////////
+// TouchEvent, public:
+
#if defined(TOUCH_UI)
TouchEvent::TouchEvent(ui::EventType type, int x, int y, int flags, int touch_id)
: LocatedEvent(type, gfx::Point(x, y), flags),
« no previous file with comments | « views/events/event.h ('k') | views/events/event_gtk.cc » ('j') | views/events/event_gtk.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698