| Index: mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| diff --git a/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc b/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| index dfa280e2eee097f318da90aa6195af2d4ac5c3b2..a4bd3307d45a9fcc86d3dd8730f59faa848e7ac2 100644
|
| --- a/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| +++ b/mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc
|
| @@ -10,6 +10,7 @@
|
| #endif
|
|
|
| #include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
|
| +#include "mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h"
|
| #include "mojo/services/public/interfaces/input_events/input_events.mojom.h"
|
| #include "ui/events/event_utils.h"
|
| #include "ui/events/keycodes/keyboard_codes.h"
|
| @@ -92,36 +93,6 @@ ui::EventType TypeConverter<EventType, ui::EventType>::ConvertTo(
|
| return ui::ET_UNKNOWN;
|
| }
|
|
|
| -class MojoExtendedKeyEventData : public ui::ExtendedKeyEventData {
|
| - public:
|
| - MojoExtendedKeyEventData(int32_t windows_key_code,
|
| - uint16_t text,
|
| - uint16_t unmodified_text)
|
| - : windows_key_code_(windows_key_code),
|
| - text_(text),
|
| - unmodified_text_(unmodified_text) {
|
| - }
|
| - virtual ~MojoExtendedKeyEventData() {}
|
| -
|
| - int32_t windows_key_code() const { return windows_key_code_; }
|
| - uint16_t text() const { return text_; }
|
| - uint16_t unmodified_text() const { return unmodified_text_; }
|
| -
|
| - // ui::ExtendedKeyEventData:
|
| - virtual ExtendedKeyEventData* Clone() const OVERRIDE {
|
| - return new MojoExtendedKeyEventData(windows_key_code_,
|
| - text_,
|
| - unmodified_text_);
|
| - }
|
| -
|
| - private:
|
| - const int32_t windows_key_code_;
|
| - const uint16_t text_;
|
| - const uint16_t unmodified_text_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(MojoExtendedKeyEventData);
|
| -};
|
| -
|
| // static
|
| EventPtr TypeConverter<EventPtr, ui::Event>::ConvertFrom(
|
| const ui::Event& input) {
|
| @@ -158,8 +129,9 @@ EventPtr TypeConverter<EventPtr, ui::Event>::ConvertFrom(
|
| const ui::KeyEvent* key_event = static_cast<const ui::KeyEvent*>(&input);
|
| KeyDataPtr key_data(KeyData::New());
|
| key_data->key_code = key_event->key_code();
|
| - key_data->is_char = key_event->is_char();
|
| key_data->native_key_code = key_event->platform_keycode();
|
| + key_data->is_char = key_event->is_char();
|
| + key_data->character = key_event->GetCharacter();
|
|
|
| if (key_event->HasNativeEvent()) {
|
| key_data->windows_key_code = static_cast<mojo::KeyboardCode>(
|
| @@ -219,16 +191,16 @@ TypeConverter<EventPtr, scoped_ptr<ui::Event> >::ConvertTo(
|
| scoped_ptr<ui::KeyEvent> key_event;
|
| if (input->key_data->is_char) {
|
| key_event.reset(new ui::KeyEvent(
|
| - static_cast<base::char16>(input->key_data->key_code),
|
| - static_cast<ui::KeyboardCode>(
|
| - input->key_data->key_code),
|
| - input->flags));
|
| + static_cast<base::char16>(input->key_data->character),
|
| + static_cast<ui::KeyboardCode>(
|
| + input->key_data->key_code),
|
| + input->flags));
|
| } else {
|
| key_event.reset(new ui::KeyEvent(
|
| - ui_event_type,
|
| - static_cast<ui::KeyboardCode>(
|
| - input->key_data->key_code),
|
| - input->flags));
|
| + ui_event_type,
|
| + static_cast<ui::KeyboardCode>(
|
| + input->key_data->key_code),
|
| + input->flags));
|
| }
|
| key_event->SetExtendedKeyEventData(scoped_ptr<ui::ExtendedKeyEventData>(
|
| new MojoExtendedKeyEventData(
|
|
|