| 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 "content/browser/renderer_host/input/web_input_event_util.h" | 5 #include "content/browser/renderer_host/input/web_input_event_util.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "third_party/WebKit/public/web/WebInputEvent.h" | 8 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return "VolumeUp"; | 122 return "VolumeUp"; |
| 123 default: | 123 default: |
| 124 return NULL; | 124 return NULL; |
| 125 }; | 125 }; |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace | 128 } // namespace |
| 129 | 129 |
| 130 namespace content { | 130 namespace content { |
| 131 | 131 |
| 132 void UpdateWindowsKeyCodeAndKeyIdentifier(WebKit::WebKeyboardEvent* event, | 132 void UpdateWindowsKeyCodeAndKeyIdentifier(blink::WebKeyboardEvent* event, |
| 133 ui::KeyboardCode windows_key_code) { | 133 ui::KeyboardCode windows_key_code) { |
| 134 event->windowsKeyCode = windows_key_code; | 134 event->windowsKeyCode = windows_key_code; |
| 135 | 135 |
| 136 const char* id = GetKeyIdentifier(windows_key_code); | 136 const char* id = GetKeyIdentifier(windows_key_code); |
| 137 if (id) { | 137 if (id) { |
| 138 base::strlcpy(event->keyIdentifier, id, sizeof(event->keyIdentifier) - 1); | 138 base::strlcpy(event->keyIdentifier, id, sizeof(event->keyIdentifier) - 1); |
| 139 } else { | 139 } else { |
| 140 base::snprintf(event->keyIdentifier, sizeof(event->keyIdentifier), "U+%04X", | 140 base::snprintf(event->keyIdentifier, sizeof(event->keyIdentifier), "U+%04X", |
| 141 base::ToUpperASCII(static_cast<int>(windows_key_code))); | 141 base::ToUpperASCII(static_cast<int>(windows_key_code))); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 } // namespace content | 145 } // namespace content |
| OLD | NEW |