| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/test/chromedriver/key_converter.h" | 5 #include "chrome/test/chromedriver/key_converter.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/test/chromedriver/chrome/status.h" | 10 #include "chrome/test/chromedriver/chrome/status.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } else { | 151 } else { |
| 152 return false; | 152 return false; |
| 153 } | 153 } |
| 154 *client_should_skip = should_skip; | 154 *client_should_skip = should_skip; |
| 155 return true; | 155 return true; |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace | 158 } // namespace |
| 159 | 159 |
| 160 KeyEvent CreateKeyDownEvent(ui::KeyboardCode key_code, int modifiers) { | 160 KeyEvent CreateKeyDownEvent(ui::KeyboardCode key_code, int modifiers) { |
| 161 return KeyEvent(kRawKeyDownEventType, modifiers, "", "", key_code); | 161 return KeyEvent( |
| 162 kRawKeyDownEventType, modifiers, std::string(), std::string(), key_code); |
| 162 } | 163 } |
| 163 | 164 |
| 164 KeyEvent CreateKeyUpEvent(ui::KeyboardCode key_code, int modifiers) { | 165 KeyEvent CreateKeyUpEvent(ui::KeyboardCode key_code, int modifiers) { |
| 165 return KeyEvent(kKeyUpEventType, modifiers, "", "", key_code); | 166 return KeyEvent( |
| 167 kKeyUpEventType, modifiers, std::string(), std::string(), key_code); |
| 166 } | 168 } |
| 167 | 169 |
| 168 KeyEvent CreateCharEvent(const std::string& unmodified_text, | 170 KeyEvent CreateCharEvent(const std::string& unmodified_text, |
| 169 const std::string& modified_text, | 171 const std::string& modified_text, |
| 170 int modifiers) { | 172 int modifiers) { |
| 171 return KeyEvent(kCharEventType, | 173 return KeyEvent(kCharEventType, |
| 172 modifiers, | 174 modifiers, |
| 173 modified_text, | 175 modified_text, |
| 174 unmodified_text, | 176 unmodified_text, |
| 175 ui::VKEY_UNKNOWN); | 177 ui::VKEY_UNKNOWN); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 if (necessary_modifiers[i]) { | 308 if (necessary_modifiers[i]) { |
| 307 key_events.push_back( | 309 key_events.push_back( |
| 308 CreateKeyUpEvent(kModifiers[i].key_code, sticky_modifiers)); | 310 CreateKeyUpEvent(kModifiers[i].key_code, sticky_modifiers)); |
| 309 } | 311 } |
| 310 } | 312 } |
| 311 } | 313 } |
| 312 client_key_events->swap(key_events); | 314 client_key_events->swap(key_events); |
| 313 *modifiers = sticky_modifiers; | 315 *modifiers = sticky_modifiers; |
| 314 return Status(kOk); | 316 return Status(kOk); |
| 315 } | 317 } |
| OLD | NEW |