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

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 74437)
+++ 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.
@@ -12,8 +12,24 @@
: 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)
+ : native_event_2_(native_event_2),
+ type_(type),
+ time_stamp_(base::Time::NowFromSystemTime()),
+ flags_(flags) {
+ InitWithNativeEvent2(native_event_2);
+}
+
LocatedEvent::LocatedEvent(const LocatedEvent& model, View* from, View* to)
: Event(model),
location_(model.location_) {
@@ -22,11 +38,9 @@
}
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::MouseEvent(ui::EventType type,
« 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