OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/services/native_viewport/platform_viewport.h" | 5 #include "mojo/services/native_viewport/platform_viewport.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data
.h" | 9 #include "mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data
.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ui::KeyEvent char_event(key_press_event->GetCharacter(), | 97 ui::KeyEvent char_event(key_press_event->GetCharacter(), |
98 key_press_event->key_code(), | 98 key_press_event->key_code(), |
99 key_press_event->flags()); | 99 key_press_event->flags()); |
100 | 100 |
101 DCHECK_EQ(key_press_event->GetCharacter(), char_event.GetCharacter()); | 101 DCHECK_EQ(key_press_event->GetCharacter(), char_event.GetCharacter()); |
102 DCHECK_EQ(key_press_event->key_code(), char_event.key_code()); | 102 DCHECK_EQ(key_press_event->key_code(), char_event.key_code()); |
103 DCHECK_EQ(key_press_event->flags(), char_event.flags()); | 103 DCHECK_EQ(key_press_event->flags(), char_event.flags()); |
104 | 104 |
105 char_event.SetExtendedKeyEventData(scoped_ptr<ui::ExtendedKeyEventData>( | 105 char_event.SetExtendedKeyEventData(scoped_ptr<ui::ExtendedKeyEventData>( |
106 new MojoExtendedKeyEventData( | 106 new MojoExtendedKeyEventData( |
107 ui::WindowsKeycodeFromNative(key_press_event->native_event()), | 107 key_press_event->GetLocatedWindowsKeyboardCode(), |
108 ui::TextFromNative(key_press_event->native_event()), | 108 key_press_event->GetText(), |
109 ui::UnmodifiedTextFromNative(key_press_event->native_event())))); | 109 key_press_event->GetUnmodifiedText()))); |
110 char_event.set_platform_keycode(key_press_event->platform_keycode()); | 110 char_event.set_platform_keycode(key_press_event->platform_keycode()); |
111 | 111 |
112 delegate_->OnEvent(&char_event); | 112 delegate_->OnEvent(&char_event); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 virtual void OnCloseRequest() OVERRIDE { | 116 virtual void OnCloseRequest() OVERRIDE { |
117 platform_window_->Close(); | 117 platform_window_->Close(); |
118 } | 118 } |
119 | 119 |
(...skipping 21 matching lines...) Expand all Loading... |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(PlatformViewportX11); | 142 DISALLOW_COPY_AND_ASSIGN(PlatformViewportX11); |
143 }; | 143 }; |
144 | 144 |
145 // static | 145 // static |
146 scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) { | 146 scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) { |
147 return scoped_ptr<PlatformViewport>(new PlatformViewportX11(delegate)).Pass(); | 147 return scoped_ptr<PlatformViewport>(new PlatformViewportX11(delegate)).Pass(); |
148 } | 148 } |
149 | 149 |
150 } // namespace mojo | 150 } // namespace mojo |
OLD | NEW |