| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_FRAME_TEST_SIMULATE_INPUT_H_ | 5 #ifndef CHROME_FRAME_TEST_SIMULATE_INPUT_H_ |
| 6 #define CHROME_FRAME_TEST_SIMULATE_INPUT_H_ | 6 #define CHROME_FRAME_TEST_SIMULATE_INPUT_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <string> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 12 | 13 |
| 13 namespace simulate_input { | 14 namespace simulate_input { |
| 14 | 15 |
| 15 enum Modifier { | 16 enum Modifier { |
| 16 NONE, | 17 NONE, |
| 17 SHIFT = 1, | 18 SHIFT = 1, |
| 18 CONTROL = 2, | 19 CONTROL = 2, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 48 void SendScanCode(short scan_code, Modifier modifiers); | 49 void SendScanCode(short scan_code, Modifier modifiers); |
| 49 void SendCharA(char c, Modifier modifiers); | 50 void SendCharA(char c, Modifier modifiers); |
| 50 void SendCharW(wchar_t c, Modifier modifiers); | 51 void SendCharW(wchar_t c, Modifier modifiers); |
| 51 | 52 |
| 52 // Sends extended keystroke to the currently active application with optional | 53 // Sends extended keystroke to the currently active application with optional |
| 53 // modifiers set. | 54 // modifiers set. |
| 54 void SendExtendedKey(WORD key, Modifier modifiers); | 55 void SendExtendedKey(WORD key, Modifier modifiers); |
| 55 | 56 |
| 56 // Iterates through all the characters in the string and simulates | 57 // Iterates through all the characters in the string and simulates |
| 57 // keyboard input. The input goes to the currently active application. | 58 // keyboard input. The input goes to the currently active application. |
| 58 void SendStringW(const wchar_t* s); | 59 void SendStringW(const std::wstring& s); |
| 59 void SendStringA(const char* s); | 60 void SendStringA(const std::string& s); |
| 60 | 61 |
| 61 } // end namespace simulate_input | 62 } // end namespace simulate_input |
| 62 | 63 |
| 63 #endif // CHROME_FRAME_TEST_SIMULATE_INPUT_H_ | 64 #endif // CHROME_FRAME_TEST_SIMULATE_INPUT_H_ |
| 64 | 65 |
| OLD | NEW |