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

Unified Diff: ui/events/keycodes/keyboard_code_conversion.h

Issue 1072193004: Take GetCharacterFromKeyCode() out behind the barn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: ui/events/keycodes/keyboard_code_conversion.h
diff --git a/ui/events/keycodes/keyboard_code_conversion.h b/ui/events/keycodes/keyboard_code_conversion.h
index 8b92ba16394eaaebd48ccbacd86bed3ec453bc99..4370a7b1fe614e8cfa88409ecad6ad12229d69d7 100644
--- a/ui/events/keycodes/keyboard_code_conversion.h
+++ b/ui/events/keycodes/keyboard_code_conversion.h
@@ -15,7 +15,7 @@ namespace ui {
enum class DomCode;
enum class DomKey;
-// Helper functions to get the meaning of a Windows key code in a
+// Helper functions to get the meaning of a DOM |code| in a
// platform independent way. It supports control characters as well.
// It assumes a US keyboard layout is used, so it may only be used when there
// is no native event or no better way to get the character.
@@ -29,16 +29,6 @@ enum class DomKey;
// character according to US keyboard layout definition. Preferably, such
// events should be created using a full KeyEvent constructor, explicitly
// specifying the character and DOM 3 values as well as the legacy VKEY.
-//
-// TODO(kpschoedel): replace remaining uses of the ...FromKeyCode() functions
-// and remove them, to avoid future creation of underspecified key events.
-// crbug.com/444045
-EVENTS_BASE_EXPORT base::char16 GetCharacterFromKeyCode(KeyboardCode key_code,
- int flags);
-EVENTS_BASE_EXPORT bool GetMeaningFromKeyCode(KeyboardCode key_code,
- int flags,
- DomKey* dom_key,
- base::char16* character);
// Helper function to map a physical key state (dom_code and flags)
// to a meaning (dom_key and character, together corresponding to the
@@ -50,6 +40,8 @@ EVENTS_BASE_EXPORT bool GetMeaningFromKeyCode(KeyboardCode key_code,
// Returns true and sets the output parameters if the (dom_code, flags) pair
// has an interpretation in the US English layout; otherwise the output
// parameters are untouched.
+EVENTS_BASE_EXPORT base::char16 DomCodeToUsLayoutCharacter(DomCode dom_code,
+ int flags);
EVENTS_BASE_EXPORT bool DomCodeToUsLayoutMeaning(DomCode dom_code,
int flags,
DomKey* dom_key,

Powered by Google App Engine
This is Rietveld 408576698