OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 | 6 |
7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 xevent.InitKeyEvent(ui::ET_KEY_RELEASED, | 216 xevent.InitKeyEvent(ui::ET_KEY_RELEASED, |
217 static_cast<ui::KeyboardCode>(key_code), | 217 static_cast<ui::KeyboardCode>(key_code), |
218 flags); | 218 flags); |
219 ui::KeyEvent event3(xevent, false); | 219 ui::KeyEvent event3(xevent, false); |
220 NativeWebKeyboardEvent keyup_event(&event3); | 220 NativeWebKeyboardEvent keyup_event(&event3); |
221 SendNativeKeyEvent(keyup_event); | 221 SendNativeKeyEvent(keyup_event); |
222 | 222 |
223 long c = GetCharacterFromKeyCode(static_cast<ui::KeyboardCode>(key_code), | 223 long c = GetCharacterFromKeyCode(static_cast<ui::KeyboardCode>(key_code), |
224 flags); | 224 flags); |
225 output->assign(1, static_cast<char16>(c)); | 225 output->assign(1, static_cast<base::char16>(c)); |
226 return 1; | 226 return 1; |
227 #elif defined(USE_OZONE) | 227 #elif defined(USE_OZONE) |
228 const int flags = ConvertMockKeyboardModifier(modifiers); | 228 const int flags = ConvertMockKeyboardModifier(modifiers); |
229 | 229 |
230 // Ozone's native events are ui::Events. So first create the "native" event, | 230 // Ozone's native events are ui::Events. So first create the "native" event, |
231 // then create the actual ui::KeyEvent with the native event. | 231 // then create the actual ui::KeyEvent with the native event. |
232 ui::KeyEvent keydown_native_event(ui::ET_KEY_PRESSED, | 232 ui::KeyEvent keydown_native_event(ui::ET_KEY_PRESSED, |
233 static_cast<ui::KeyboardCode>(key_code), | 233 static_cast<ui::KeyboardCode>(key_code), |
234 flags, | 234 flags, |
235 true); | 235 true); |
(...skipping 12 matching lines...) Expand all Loading... |
248 ui::KeyEvent keyup_native_event(ui::ET_KEY_RELEASED, | 248 ui::KeyEvent keyup_native_event(ui::ET_KEY_RELEASED, |
249 static_cast<ui::KeyboardCode>(key_code), | 249 static_cast<ui::KeyboardCode>(key_code), |
250 flags, | 250 flags, |
251 true); | 251 true); |
252 ui::KeyEvent keyup_event(&keyup_native_event, false); | 252 ui::KeyEvent keyup_event(&keyup_native_event, false); |
253 NativeWebKeyboardEvent keyup_web_event(&keyup_event); | 253 NativeWebKeyboardEvent keyup_web_event(&keyup_event); |
254 SendNativeKeyEvent(keyup_web_event); | 254 SendNativeKeyEvent(keyup_web_event); |
255 | 255 |
256 long c = GetCharacterFromKeyCode(static_cast<ui::KeyboardCode>(key_code), | 256 long c = GetCharacterFromKeyCode(static_cast<ui::KeyboardCode>(key_code), |
257 flags); | 257 flags); |
258 output->assign(1, static_cast<char16>(c)); | 258 output->assign(1, static_cast<base::char16>(c)); |
259 return 1; | 259 return 1; |
260 #elif defined(TOOLKIT_GTK) | 260 #elif defined(TOOLKIT_GTK) |
261 // We ignore |layout|, which means we are only testing the layout of the | 261 // We ignore |layout|, which means we are only testing the layout of the |
262 // current locale. TODO(estade): fix this to respect |layout|. | 262 // current locale. TODO(estade): fix this to respect |layout|. |
263 std::vector<GdkEvent*> events; | 263 std::vector<GdkEvent*> events; |
264 ui::SynthesizeKeyPressEvents( | 264 ui::SynthesizeKeyPressEvents( |
265 NULL, static_cast<ui::KeyboardCode>(key_code), | 265 NULL, static_cast<ui::KeyboardCode>(key_code), |
266 modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), | 266 modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), |
267 modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), | 267 modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), |
268 modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), | 268 modifiers & (MockKeyboard::LEFT_ALT | MockKeyboard::RIGHT_ALT), |
(...skipping 12 matching lines...) Expand all Loading... |
281 if (webkit_event.type == blink::WebInputEvent::RawKeyDown) { | 281 if (webkit_event.type == blink::WebInputEvent::RawKeyDown) { |
282 NativeWebKeyboardEvent char_event = webkit_event; | 282 NativeWebKeyboardEvent char_event = webkit_event; |
283 char_event.type = blink::WebInputEvent::Char; | 283 char_event.type = blink::WebInputEvent::Char; |
284 char_event.skip_in_browser = true; | 284 char_event.skip_in_browser = true; |
285 SendNativeKeyEvent(char_event); | 285 SendNativeKeyEvent(char_event); |
286 } | 286 } |
287 } | 287 } |
288 gdk_event_free(events[i]); | 288 gdk_event_free(events[i]); |
289 } | 289 } |
290 | 290 |
291 output->assign(1, static_cast<char16>(unicode_key)); | 291 output->assign(1, static_cast<base::char16>(unicode_key)); |
292 return 1; | 292 return 1; |
293 #else | 293 #else |
294 NOTIMPLEMENTED(); | 294 NOTIMPLEMENTED(); |
295 return L'\0'; | 295 return L'\0'; |
296 #endif | 296 #endif |
297 } | 297 } |
298 | 298 |
299 private: | 299 private: |
300 scoped_ptr<MockKeyboard> mock_keyboard_; | 300 scoped_ptr<MockKeyboard> mock_keyboard_; |
301 }; | 301 }; |
(...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2197 // made by some of Chrome's favicon handling. | 2197 // made by some of Chrome's favicon handling. |
2198 LoadHTML("<html>" | 2198 LoadHTML("<html>" |
2199 "<head>" | 2199 "<head>" |
2200 "</head>" | 2200 "</head>" |
2201 "</html>"); | 2201 "</html>"); |
2202 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( | 2202 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( |
2203 ViewHostMsg_UpdateFaviconURL::ID)); | 2203 ViewHostMsg_UpdateFaviconURL::ID)); |
2204 } | 2204 } |
2205 | 2205 |
2206 } // namespace content | 2206 } // namespace content |
OLD | NEW |