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

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed)

Created:
9 years, 8 months ago by msw
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Add NativeWidgetDelegate/Widget::OnKeyEvent post-IME handling. Refactor XEvent code and InputMethodGtk::DispatchKeyEvent. Nix WidgetWin::GetFocusedViewRootView, rename RootView::OnKeyEvent. Cleanup headers and refactor code in extension_input_api.cc. Rename WidgetGtk::OnEventKey to avoid overloading Widget::OnEventKey. BUG=72040 TEST=Key event handling in win/linux_views/touch; extension input API SendKeyboardEventInputFunction use. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82713 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82751 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82983

Patch Set 1 #

Patch Set 2 : Fix KeyEvent construction, InputMethod functions, etc. #

Patch Set 3 : Reduce the scope of this change. #

Total comments: 6

Patch Set 4 : Refactor X2Event handling, nix Windows InputMethodDelegate, etc. #

Total comments: 4

Patch Set 5 : Resore most InputMethod code. #

Total comments: 2

Patch Set 6 : Encapsulate RootView use to SendKeyboardEventInputFunction::GetTopLevelWidget. #

Patch Set 7 : Nix RootView from extension_input_api, revert mouse and touch event changes. #

Total comments: 2

Patch Set 8 : Rename WidgetGtk::OnEventKey to avoid overload with Widget::OnKeyEvent. #

Patch Set 9 : Update additional OnEventKey references. #

Total comments: 3

Patch Set 10 : Restore IME call in accelerator_handler_touch.cc. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -137 lines) Patch
M chrome/browser/chromeos/login/screen_locker.cc View 1 2 3 4 5 6 7 8 15 chunks +24 lines, -23 lines 0 comments Download
M chrome/browser/extensions/extension_input_api.h View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extension_input_api.cc View 1 2 3 4 5 6 4 chunks +13 lines, -29 lines 0 comments Download
M views/focus/accelerator_handler_gtk.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M views/focus/accelerator_handler_touch.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M views/ime/input_method_gtk.cc View 1 2 3 4 4 chunks +27 lines, -45 lines 0 comments Download
M views/widget/native_widget_delegate.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M views/widget/root_view.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M views/widget/root_view.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M views/widget/widget.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M views/widget/widget.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M views/widget/widget_gtk.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M views/widget/widget_gtk.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -7 lines 0 comments Download
M views/widget/widget_win.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -4 lines 0 comments Download
M views/widget/widget_win.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -18 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
msw
Hey Ben, I was hoping to achieve something closer to Patch Set 2, but got ...
9 years, 8 months ago (2011-04-12 20:57:00 UTC) #1
Ben Goodger (Google)
http://codereview.chromium.org/6823055/diff/2013/views/widget/widget.cc File views/widget/widget.cc (right): http://codereview.chromium.org/6823055/diff/2013/views/widget/widget.cc#newcode333 views/widget/widget.cc:333: DispatchKeyEventPostIME(event); I looked at InputMethod's DispatchKeyEvent/calling of DispatchKeyEventPostIME. I ...
9 years, 8 months ago (2011-04-12 21:11:15 UTC) #2
Ben Goodger (Google)
On 2011/04/12 21:11:15, Ben Goodger wrote: > bool handled = true; > if (GetInputMethod()) > ...
9 years, 8 months ago (2011-04-12 21:15:18 UTC) #3
msw
This is a good first step to reduce some KeyEvent handling complexity while I learn ...
9 years, 8 months ago (2011-04-14 21:47:39 UTC) #4
James Su
Sorry that I plan to have a vacation today for some personal affair. I'll try ...
9 years, 8 months ago (2011-04-15 02:04:17 UTC) #5
Ben Goodger (Google)
I am really liking where this change is going Mike. A few comments: http://codereview.chromium.org/6823055/diff/12023/views/ime/input_method_delegate.h File ...
9 years, 8 months ago (2011-04-15 18:23:19 UTC) #6
msw
On 2011/04/15 18:23:19, Ben Goodger wrote: > I am really liking where this change is ...
9 years, 8 months ago (2011-04-15 19:19:32 UTC) #7
msw
Forgot to send along inline responses... http://codereview.chromium.org/6823055/diff/12023/views/ime/input_method_delegate.h File views/ime/input_method_delegate.h (right): http://codereview.chromium.org/6823055/diff/12023/views/ime/input_method_delegate.h#newcode22 views/ime/input_method_delegate.h:22: virtual bool DispatchKeyEventPostIME(const ...
9 years, 8 months ago (2011-04-15 19:19:57 UTC) #8
Ben Goodger (Google)
But it's not really asynchronous. i.e. the code currently does this: WidgetWin::OnKeyFoo input_method_->OnKeyEvent(..); InputMethod::OnKeyEvent ...
9 years, 8 months ago (2011-04-15 19:58:16 UTC) #9
James Su
InputMethodWin is currently just a simple synchronous implementation, but InputMethodIBus is a full asynchronous implementation. ...
9 years, 8 months ago (2011-04-18 07:59:34 UTC) #10
Ben Goodger (Google)
OK this makes more sense now. However, I don't think the platform-specific widget subclasses should ...
9 years, 8 months ago (2011-04-18 17:16:25 UTC) #11
msw
On 2011/04/18 17:16:25, Ben Goodger wrote: > OK this makes more sense now. > > ...
9 years, 8 months ago (2011-04-18 20:48:14 UTC) #12
suzhe
I'd still prefer to implement InputMethodDelegate in NativeWidget classes. Regards James Su 在 2011年4月19日 上午1:16,Ben ...
9 years, 8 months ago (2011-04-18 22:12:12 UTC) #13
Ben Goodger (Google)
Is the consultation with input method extensions going to be handled internally to each platform ...
9 years, 8 months ago (2011-04-18 23:30:37 UTC) #14
suzhe
在 2011年4月19日 上午7:30,Ben Goodger (Google) <ben@chromium.org>写道: > Is the consultation with input method extensions going ...
9 years, 8 months ago (2011-04-19 00:44:36 UTC) #15
Ben Goodger (Google)
Are the extensions like regular chrome extensions? Or something else? -Ben On Mon, Apr 18, ...
9 years, 8 months ago (2011-04-19 00:47:17 UTC) #16
James Su
I can't see much benefit of the changes to InputMethod and InputMethodDelegate interfaces. Can you ...
9 years, 8 months ago (2011-04-19 09:38:56 UTC) #17
Ben Goodger (Google)
If the extensions are Chrome extensions, then it makes sense that the code that dispatches ...
9 years, 8 months ago (2011-04-19 15:00:12 UTC) #18
suzhe
在 2011年4月19日 下午11:00,Ben Goodger (Google) <ben@chromium.org>写道: > If the extensions are Chrome extensions, then it ...
9 years, 8 months ago (2011-04-19 15:34:57 UTC) #19
Ben Goodger (Google)
Where does the native IME translation happen on ChromeOS - before the native event reaches ...
9 years, 8 months ago (2011-04-19 15:45:51 UTC) #20
Ben Goodger (Google)
Where does the native IME translation happen on ChromeOS - before the native event reaches ...
9 years, 8 months ago (2011-04-19 15:47:54 UTC) #21
suzhe
在 2011年4月19日 下午11:45,Ben Goodger (Google) <ben@chromium.org>写道: > Where does the native IME translation happen on ...
9 years, 8 months ago (2011-04-19 16:03:45 UTC) #22
Ben Goodger (Google)
I guess my main question is - is there a good reason to have cross ...
9 years, 8 months ago (2011-04-19 16:26:50 UTC) #23
suzhe
在 2011年4月20日 上午12:26,Ben Goodger (Google) <ben@chromium.org>写道: > I guess my main question is - is ...
9 years, 8 months ago (2011-04-20 01:37:35 UTC) #24
Ben Goodger (Google)
OK. I am OK with isolating the IME stuff in the native widget for now. ...
9 years, 8 months ago (2011-04-20 15:08:22 UTC) #25
msw
This simpler change should capture our current goals; PTAL. Sadrul: please review accelerator_handler_touch.cc.
9 years, 8 months ago (2011-04-20 22:26:16 UTC) #26
Ben Goodger (Google)
http://codereview.chromium.org/6823055/diff/29008/chrome/browser/extensions/extension_input_api.cc File chrome/browser/extensions/extension_input_api.cc (right): http://codereview.chromium.org/6823055/diff/29008/chrome/browser/extensions/extension_input_api.cc#newcode118 chrome/browser/extensions/extension_input_api.cc:118: views::RootView* root_view = GetRootView(); RootView is going to become ...
9 years, 8 months ago (2011-04-20 23:12:05 UTC) #27
sadrul
On 2011/04/20 22:26:16, msw wrote: > This simpler change should capture our current goals; PTAL. ...
9 years, 8 months ago (2011-04-21 13:56:19 UTC) #28
msw
PTAL; thanks! http://codereview.chromium.org/6823055/diff/29008/chrome/browser/extensions/extension_input_api.cc File chrome/browser/extensions/extension_input_api.cc (right): http://codereview.chromium.org/6823055/diff/29008/chrome/browser/extensions/extension_input_api.cc#newcode118 chrome/browser/extensions/extension_input_api.cc:118: views::RootView* root_view = GetRootView(); On 2011/04/20 23:12:05, ...
9 years, 8 months ago (2011-04-21 19:19:24 UTC) #29
msw
Ping! I removed RootView use from extension_input_api and reverted the mouse and touch event changes ...
9 years, 8 months ago (2011-04-22 17:52:02 UTC) #30
Ben Goodger (Google)
LGTM http://codereview.chromium.org/6823055/diff/32001/chrome/browser/extensions/extension_input_api.h File chrome/browser/extensions/extension_input_api.h (right): http://codereview.chromium.org/6823055/diff/32001/chrome/browser/extensions/extension_input_api.h#newcode12 chrome/browser/extensions/extension_input_api.h:12: class Widget; nit: outdent 2 spaces
9 years, 8 months ago (2011-04-22 20:23:45 UTC) #31
msw
Just FYI; addressed your nit. http://codereview.chromium.org/6823055/diff/32001/chrome/browser/extensions/extension_input_api.h File chrome/browser/extensions/extension_input_api.h (right): http://codereview.chromium.org/6823055/diff/32001/chrome/browser/extensions/extension_input_api.h#newcode12 chrome/browser/extensions/extension_input_api.h:12: class Widget; On 2011/04/22 ...
9 years, 8 months ago (2011-04-22 21:34:38 UTC) #32
msw
Please take one more quick look, sorry! I fixed a Linux Views Clang error by ...
9 years, 8 months ago (2011-04-22 22:15:18 UTC) #33
Ben Goodger (Google)
LGTM
9 years, 8 months ago (2011-04-22 22:30:45 UTC) #34
msw
Third time's a charm! PTAL. Linux_ChromiumOS and ARM failures should now be fixed with updated ...
9 years, 8 months ago (2011-04-23 00:27:25 UTC) #35
suzhe
I'm out of office this week (offsite), will check this CL again next Monday. 在 ...
9 years, 8 months ago (2011-04-23 03:17:01 UTC) #36
James Su
LGTM, except one issue: http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_handler_touch.cc#newcode182 views/focus/accelerator_handler_touch.cc:182: return widget->OnKeyEvent(keyev); This change breaks ...
9 years, 8 months ago (2011-04-25 03:37:03 UTC) #37
James Su
http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_handler_touch.cc#newcode182 views/focus/accelerator_handler_touch.cc:182: return widget->OnKeyEvent(keyev); On 2011/04/25 03:37:03, James Su wrote: > ...
9 years, 8 months ago (2011-04-25 03:46:32 UTC) #38
msw
Issue addressed. PTAL, James. http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_handler_touch.cc#newcode182 views/focus/accelerator_handler_touch.cc:182: return widget->OnKeyEvent(keyev); On 2011/04/25 03:46:32, ...
9 years, 8 months ago (2011-04-25 17:52:38 UTC) #39
James Su
9 years, 8 months ago (2011-04-26 01:24:22 UTC) #40
Thanks, LGTM now.

On 2011/04/25 17:52:38, msw wrote:
> Issue addressed. PTAL, James.
> 
>
http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_han...
> File views/focus/accelerator_handler_touch.cc (right):
> 
>
http://codereview.chromium.org/6823055/diff/36008/views/focus/accelerator_han...
> views/focus/accelerator_handler_touch.cc:182: return
widget->OnKeyEvent(keyev);
> On 2011/04/25 03:46:32, James Su wrote:
> > On 2011/04/25 03:37:03, James Su wrote:
> > > This change breaks IME when using hardware keyboard.
> > 
> > To be more clear: we always need to dispatch a key event to the input method
> > before views hierarchy. Otherwise, even though most key events may be
> dispatched
> > to the input method through WidgetGtk::OnEventKey if
widget->OnKeyEvent(keyev)
> > returns false, functions of the input method may be broken if some keys are
> > handled in widget->OnKeyEvent(keyev).
> > And this change may cause a key event to be dispatched to views hierarchy
> twice.
> 
> Done. Logic restored with updated call to Widget.

Powered by Google App Engine
This is Rietveld 408576698