OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_TEST_WEBDRIVER_KEYMAP_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_KEYMAP_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/keyboard_codes.h" |
| 11 #include "chrome/test/automation/window_proxy.h" |
| 12 |
| 13 namespace webdriver { |
| 14 |
| 15 // Maps the key space used by WebDriver to Chrome for Linux/Mac/Windows. |
| 16 class KeyMap { |
| 17 public: |
| 18 KeyMap(); |
| 19 base::KeyboardCode Get(const wchar_t& key) const; |
| 20 |
| 21 bool Press(const scoped_refptr<WindowProxy>& window, |
| 22 const base::KeyboardCode key_code, |
| 23 const wchar_t& key); |
| 24 |
| 25 // Sets the Shift, Alt, Cntl, and Cmd keys to not pressed |
| 26 void ClearModifiers(); |
| 27 |
| 28 private: |
| 29 bool shift_; |
| 30 bool alt_; |
| 31 bool control_; |
| 32 bool command_; |
| 33 std::map<wchar_t, base::KeyboardCode> keys_; |
| 34 std::map<wchar_t, base::KeyboardCode> shifted_keys_; |
| 35 DISALLOW_COPY_AND_ASSIGN(KeyMap); |
| 36 }; |
| 37 } // namespace webdriver |
| 38 #endif // CHROME_TEST_WEBDRIVER_KEYMAP_H_ |
| 39 |
OLD | NEW |