Combine the WM_CHAR with WM_KEY* for key event flow.

The combination is required for Chrome IMEs, which can do IME related actions based on the single event.
Chrome IME extension may wants to consume certain key events based on the character information of WM_CHAR messages. Holding WM_KEY* messages until WM_CHAR is processed by the IME extension is not feasible because there is no way to know wether there will or not be a WM_CHAR following the WM_KEY*.

What's more, with the combination, ui::KeyEvent::is_char() can be removed, can reduce the complexity for key event handling.

This cl will change a little for the order of message handling. e.g.
Original:
 - WM_KEYDOWN received in message pump.
 - TranslateMessage is called from message pump.
 - WM_KEYDOWN is dispatched to HWNDMessageHandler.
 - WM_KEYDOWN is dispatched to Chrome by IMF.

With this cl:
 - WM_KEYDOWN received in message pump.
 - WM_KEYDOWN is dispatched to HWNDMessageHandler.
 - TranslateMessage is called from IMF.
 - WM_KEYDOWN is dispatched to Chrome by IMF.

Also, this cl makes WM_CHAR messages (generated by WM_KEY*) never hit message pump & HWNDMessageHandler.

Note: the behavior changes by this cl is behind the flag merge-key-char-events, and the flag default is "disabled".

[email protected]
BUG=517773
TEST=No regressions for text inputing (including dead keys & CJK IMEs) in Windows 7 and Windows 8 metro.

Review URL: https://codereview.chromium.org/1267483003

Cr-Commit-Position: refs/heads/master@{#353106}
diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc
index dd98536..db9c274 100644
--- a/ui/base/ui_base_switches.cc
+++ b/ui/base/ui_base_switches.cc
@@ -19,6 +19,14 @@
 const char kShowMacOverlayBorders[] = "show-mac-overlay-borders";
 #endif
 
+#if defined(OS_WIN)
+// Disables merging the key event (WM_KEY*) with the char event (WM_CHAR).
+const char kDisableMergeKeyCharEvents[]     = "disable-merge-key-char-events";
+
+// Enables merging the key event (WM_KEY*) with the char event (WM_CHAR).
+const char kEnableMergeKeyCharEvents[]     = "enable-merge-key-char-events";
+#endif
+
 // Disables use of DWM composition for top level windows.
 const char kDisableDwmComposition[] = "disable-dwm-composition";