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

Issue 1135083004: Revert of Remove EF_FUNCTION_KEY and EF_NUMPAD_KEY. (Closed)

Created:
5 years, 7 months ago by benwells
Modified:
5 years, 7 months ago
CC:
chromium-reviews, tdresser+watch_chromium.org, stevenjb+watch_chromium.org, jam, darin-cc_chromium.org, oshima+watch_chromium.org, jdduke+watch_chromium.org, davemoore+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revert of Remove EF_FUNCTION_KEY and EF_NUMPAD_KEY. (patchset #5 id:180001 of https://codereview.chromium.org/1120813002/) Reason for revert: This is failing on the chromeos valgrind bot. e.g.: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%284%29/builds/32560 Sample output: WebInputEventAuraTest.TestMakeWebKeyboardEventKeyPadKeyCode: ../../content/browser/renderer_host/web_input_event_aura_unittest.cc:207: Failure Value of: (webkit_event.modifiers & blink::WebInputEvent::IsKeyPad) != 0 Actual: false Expected: test_case.expected_result Which is: true Failed in 23th test case: {dom_code:NumpadDivide, ui_keycode:111, x_keysym:65455}, expect: true ../../content/browser/renderer_host/web_input_event_aura_unittest.cc:207: Failure Value of: (webkit_event.modifiers & blink::WebInputEvent::IsKeyPad) != 0 Actual: false Expected: test_case.expected_result Which is: true Failed in 24th test case: {dom_code:NumpadDecimal, ui_keycode:110, x_keysym:65454}, expect: true Original issue's description: > Remove EF_FUNCTION_KEY and EF_NUMPAD_KEY. > > These EventFlags are redundant now that DomCode exists, and were not > always set correctly or kept in sync. > > Committed: https://crrev.com/8226fd15e53b122f531b3b1816b3e080bd8ef011 > Cr-Commit-Position: refs/heads/master@{#328543} TBR=derat@chromium.org,wez@chromium.org,sadrul@chromium.org,kpschoedel@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1144 lines, -2283 lines) Patch
M chrome/browser/chromeos/events/event_rewriter.cc View 3 chunks +18 lines, -26 lines 0 comments Download
M chrome/browser/chromeos/events/event_rewriter_unittest.cc View 57 chunks +886 lines, -2092 lines 0 comments Download
M content/browser/renderer_host/input/web_input_event_util.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/web_input_event_aura.cc View 1 chunk +0 lines, -13 lines 0 comments Download
M content/browser/renderer_host/web_input_event_aura_unittest.cc View 5 chunks +48 lines, -88 lines 0 comments Download
M ui/events/blink/blink_event_util.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M ui/events/event_constants.h View 1 chunk +5 lines, -3 lines 0 comments Download
M ui/events/keycodes/dom4/keycode_converter.h View 2 chunks +0 lines, -7 lines 0 comments Download
M ui/events/keycodes/dom4/keycode_converter.cc View 1 chunk +0 lines, -49 lines 0 comments Download
M ui/events/keycodes/dom4/keycode_converter_data.h View 1 chunk +2 lines, -1 line 0 comments Download
M ui/events/keycodes/dom4/keycode_converter_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/events/test/events_test_utils_x11.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/events/x/events_x.cc View 3 chunks +9 lines, -1 line 0 comments Download
M ui/events/x/events_x_unittest.cc View 3 chunks +170 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
benwells
Created Revert of Remove EF_FUNCTION_KEY and EF_NUMPAD_KEY.
5 years, 7 months ago (2015-05-12 01:30:07 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1135083004/1
5 years, 7 months ago (2015-05-12 01:31:01 UTC) #2
commit-bot: I haz the power
5 years, 7 months ago (2015-05-12 01:37:43 UTC) #4
Failed to apply patch for chrome/browser/chromeos/events/event_rewriter.cc:
While running git apply --index -3 -p1;
  error: patch failed: chrome/browser/chromeos/events/event_rewriter.cc:26
  Falling back to three-way merge...
  Applied patch to 'chrome/browser/chromeos/events/event_rewriter.cc' with
conflicts.
  U chrome/browser/chromeos/events/event_rewriter.cc

Patch:       chrome/browser/chromeos/events/event_rewriter.cc
Index: chrome/browser/chromeos/events/event_rewriter.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter.cc
b/chrome/browser/chromeos/events/event_rewriter.cc
index
d21842f94e324748661a69833dfd1abd93d09437..015502d240ca2cde5d1b5d685c8ceb4fbe9f7b3c
100644
--- a/chrome/browser/chromeos/events/event_rewriter.cc
+++ b/chrome/browser/chromeos/events/event_rewriter.cc
@@ -26,8 +26,6 @@
 #include "ui/events/devices/device_data_manager.h"
 #include "ui/events/event.h"
 #include "ui/events/event_utils.h"
-#include "ui/events/keycodes/dom3/dom_code.h"
-#include "ui/events/keycodes/dom4/keycode_converter.h"
 #include "ui/events/keycodes/keyboard_code_conversion.h"
 #include "ui/wm/core/window_util.h"
 
@@ -289,7 +287,6 @@
         numpad_xevent.xkey.keycode = original_x11_keycode;
       rewritten_key_event->set_character(
           ui::GetCharacterFromXEvent(&numpad_xevent));
-      rewritten_key_event->native_event()->xkey.state |= Mod2Mask;
     }
   }
 #endif
@@ -710,31 +707,26 @@
                                       MutableKeyState* state) {
   DCHECK(key_event.type() == ui::ET_KEY_PRESSED ||
          key_event.type() == ui::ET_KEY_RELEASED);
+  if (!(state->flags & ui::EF_NUMPAD_KEY))
+    return;
   MutableKeyState incoming = *state;
-  static const struct NumPadRemapping {
-    ui::DomCode input_dom_code;
-    ui::KeyboardCode input_key_code;
-    ui::KeyboardCode output_key_code;
-  } kNumPadRemappings[] = {
-      {ui::DomCode::NUMPAD_DECIMAL, ui::VKEY_DELETE, ui::VKEY_DECIMAL},
-      {ui::DomCode::NUMPAD0, ui::VKEY_INSERT, ui::VKEY_NUMPAD0},
-      {ui::DomCode::NUMPAD1, ui::VKEY_END, ui::VKEY_NUMPAD1},
-      {ui::DomCode::NUMPAD2, ui::VKEY_DOWN, ui::VKEY_NUMPAD2},
-      {ui::DomCode::NUMPAD3, ui::VKEY_NEXT, ui::VKEY_NUMPAD3},
-      {ui::DomCode::NUMPAD4, ui::VKEY_LEFT, ui::VKEY_NUMPAD4},
-      {ui::DomCode::NUMPAD5, ui::VKEY_CLEAR, ui::VKEY_NUMPAD5},
-      {ui::DomCode::NUMPAD6, ui::VKEY_RIGHT, ui::VKEY_NUMPAD6},
-      {ui::DomCode::NUMPAD7, ui::VKEY_HOME, ui::VKEY_NUMPAD7},
-      {ui::DomCode::NUMPAD8, ui::VKEY_UP, ui::VKEY_NUMPAD8},
-      {ui::DomCode::NUMPAD9, ui::VKEY_PRIOR, ui::VKEY_NUMPAD9},
+
+  static const KeyboardRemapping kNumPadRemappings[] = {
+      {ui::VKEY_INSERT, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD0,
ui::EF_NUMPAD_KEY},
+      {ui::VKEY_DELETE, ui::EF_NUMPAD_KEY, ui::VKEY_DECIMAL,
ui::EF_NUMPAD_KEY},
+      {ui::VKEY_END, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD1, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_DOWN, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD2, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_NEXT, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD3, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_LEFT, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD4, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_CLEAR, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD5, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_RIGHT, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD6, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_HOME, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD7, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_UP, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD8, ui::EF_NUMPAD_KEY},
+      {ui::VKEY_PRIOR, ui::EF_NUMPAD_KEY, ui::VKEY_NUMPAD9, ui::EF_NUMPAD_KEY},
   };
-  for (const auto& map : kNumPadRemappings) {
-    if ((incoming.key_code == map.input_key_code) &&
-        (key_event.code() == map.input_dom_code)) {
-      state->key_code = map.output_key_code;
-      break;
-    }
-  }
+
+  RewriteWithKeyboardRemappingsByKeyCode(
+      kNumPadRemappings, arraysize(kNumPadRemappings), incoming, state);
 }
 
 void EventRewriter::RewriteExtendedKeys(const ui::KeyEvent& key_event,

Powered by Google App Engine
This is Rietveld 408576698