Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4021)

Unified Diff: chrome/test/chromedriver/keycode_text_conversion_ozone.cc

Issue 2952383002: use ozone implementation for key code conversion when there is no X display (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/keycode_text_conversion_ozone.cc
diff --git a/chrome/test/chromedriver/keycode_text_conversion_ozone.cc b/chrome/test/chromedriver/keycode_text_conversion_ozone.cc
index 4ac8a002f9bcad8215aacf6029639542e8fff4c9..6d07880647e4570097582a376da2037dd9b0c28e 100644
--- a/chrome/test/chromedriver/keycode_text_conversion_ozone.cc
+++ b/chrome/test/chromedriver/keycode_text_conversion_ozone.cc
@@ -14,10 +14,15 @@
#include "ui/events/ozone/layout/keyboard_layout_engine.h"
#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
-bool ConvertKeyCodeToText(ui::KeyboardCode key_code,
- int modifiers,
- std::string* text,
- std::string* error_msg) {
+#if defined(USE_X11)
+bool ConvertKeyCodeToTextOzone
+#else
+bool ConvertKeyCodeToText
+#endif
+ (ui::KeyboardCode key_code,
+ int modifiers,
+ std::string* text,
+ std::string* error_msg) {
ui::KeyboardLayoutEngine* keyboard_layout_engine =
ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine();
ui::DomCode dom_code = ui::UsLayoutKeyboardCodeToDomCode(key_code);
@@ -48,10 +53,15 @@ bool ConvertKeyCodeToText(ui::KeyboardCode key_code,
return true;
}
-bool ConvertCharToKeyCode(base::char16 key,
- ui::KeyboardCode* key_code,
- int* necessary_modifiers,
- std::string* error_msg) {
+#if defined(USE_X11)
+bool ConvertCharToKeyCodeOzone
+#else
+bool ConvertCharToKeyCode
+#endif
+ (base::char16 key,
+ ui::KeyboardCode* key_code,
+ int* necessary_modifiers,
+ std::string* error_msg) {
base::string16 key_string;
key_string.push_back(key);
std::string key_string_utf8 = base::UTF16ToUTF8(key_string);
« no previous file with comments | « chrome/test/chromedriver/keycode_text_conversion.h ('k') | chrome/test/chromedriver/keycode_text_conversion_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698