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

Issue 6675005: Integrate the new input method API for Views into Chromium. (Closed)

Created:
9 years, 9 months ago by James Su
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Integrate the new input method API for Views into Chromium. This CL contains following changes: 1. Improve TextfieldViewsModel to support composition text. 2. Implement TextInputClient interface in NativeTextfieldViews. 3. Fix Textfield and native implementations to avoid calling TextfieldController::ContentsChanged() when the text is changed by calling Textfield::SetText() or AppendText(). 4. Fix a bug in FocusManager that causes NativeTextfieldViewsTest.FocusTraversalTest to fail. 5. Fix accelerator_handler_touch.cc to send key events to the top-level widget's input method instance instead of the root view. 6. Do the same fix in extension_input_api.cc. 7. Hook InputMethod into WidgetGtk and WidgetWin. BUG=75003 TEST=views_unittests --gtest_filter=NativeTextfieldViews* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80226

Patch Set 1 #

Total comments: 16

Patch Set 2 : Fix compile error. #

Patch Set 3 : Add some DCHECKs. #

Total comments: 28

Patch Set 4 : Address comment feedbacks. #

Patch Set 5 : Fix trybot failures. #

Total comments: 2

Patch Set 6 : Adress review feedbacks. #

Patch Set 7 : Rebase. #

Patch Set 8 : Fix bugs related to TouchUI. #

Patch Set 9 : Fix a weird compile error on trybots. #

Patch Set 10 : Rebase. #

Total comments: 23

Patch Set 11 : Disable input method if TextfieldViews is not enabled. #

Patch Set 12 : Enable GetTextFromRange. #

Patch Set 13 : Rebase #

Total comments: 2

Patch Set 14 : Update copyright headers. #

Patch Set 15 : Update according to review feedback. #

Patch Set 16 : TouchUI: Always dispatch key events to the input method. #

Total comments: 15

Patch Set 17 : Update. #

Patch Set 18 : Rebase #

Patch Set 19 : Rename OnFocusIn/OnFocusOut to OnFocus/OnBlur. #

Patch Set 20 : Fix unittest. #

Patch Set 21 : Remove redundant check of focus state. #

Total comments: 2

Patch Set 22 : Update. #

Patch Set 23 : Rebase. #

Patch Set 24 : Rebase #

Patch Set 25 : Fix Windows build. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1477 lines, -363 lines) Patch
M chrome/browser/chromeos/login/account_screen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/eula_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/html_page_screen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/registration_screen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extension_input_api.cc View 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/ui/views/find_bar_view.h View 1 chunk +0 lines, -9 lines 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -15 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/html_dialog_view.cc View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -2 lines 0 comments Download
M views/controls/textfield/native_textfield_gtk.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/controls/textfield/native_textfield_gtk.cc View 1 2 3 4 5 6 7 3 chunks +7 lines, -8 lines 0 comments Download
M views/controls/textfield/native_textfield_views.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 7 chunks +41 lines, -2 lines 0 comments Download
M views/controls/textfield/native_textfield_views.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 17 chunks +208 lines, -31 lines 0 comments Download
M views/controls/textfield/native_textfield_views_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 18 chunks +299 lines, -104 lines 0 comments Download
M views/controls/textfield/native_textfield_win.h View 1 chunk +1 line, -0 lines 0 comments Download
M views/controls/textfield/native_textfield_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +4 lines, -4 lines 0 comments Download
M views/controls/textfield/native_textfield_wrapper.h View 2 chunks +5 lines, -0 lines 0 comments Download
M views/controls/textfield/textfield.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M views/controls/textfield/textfield.cc View 2 chunks +12 lines, -2 lines 0 comments Download
M views/controls/textfield/textfield_controller.h View 1 chunk +3 lines, -1 line 0 comments Download
M views/controls/textfield/textfield_views_model.h View 1 2 3 4 5 6 7 8 9 10 9 chunks +95 lines, -13 lines 0 comments Download
M views/controls/textfield/textfield_views_model.cc View 1 2 3 13 chunks +258 lines, -50 lines 0 comments Download
M views/controls/textfield/textfield_views_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 23 chunks +234 lines, -40 lines 0 comments Download
M views/focus/accelerator_handler_touch.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +13 lines, -4 lines 0 comments Download
M views/focus/focus_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -5 lines 0 comments Download
M views/view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -2 lines 0 comments Download
M views/widget/native_widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 chunks +12 lines, -0 lines 0 comments Download
M views/widget/widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +5 lines, -0 lines 0 comments Download
M views/widget/widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +7 lines, -0 lines 0 comments Download
M views/widget/widget_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +12 lines, -2 lines 0 comments Download
M views/widget/widget_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 10 chunks +88 lines, -41 lines 0 comments Download
M views/widget/widget_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 8 chunks +28 lines, -3 lines 0 comments Download
M views/widget/widget_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 9 chunks +102 lines, -11 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
James Su
Hi all, This is the sixth CL that does the final integration. It depends on: ...
9 years, 9 months ago (2011-03-21 19:13:50 UTC) #1
sadrul
http://codereview.chromium.org/6675005/diff/1/views/widget/widget_gtk.cc File views/widget/widget_gtk.cc (right): http://codereview.chromium.org/6675005/diff/1/views/widget/widget_gtk.cc#newcode1202 views/widget/widget_gtk.cc:1202: DispatchKeyEventPostIME(key); return DispatchKeyEventPostIME(key); http://codereview.chromium.org/6675005/diff/1/views/widget/widget_gtk.cc#newcode1322 views/widget/widget_gtk.cc:1322: } return GTK_IS_WINDOW(widget) ? ...
9 years, 9 months ago (2011-03-21 19:57:45 UTC) #2
James Su
http://codereview.chromium.org/6675005/diff/1/views/widget/widget_gtk.cc File views/widget/widget_gtk.cc (right): http://codereview.chromium.org/6675005/diff/1/views/widget/widget_gtk.cc#newcode1202 views/widget/widget_gtk.cc:1202: DispatchKeyEventPostIME(key); On 2011/03/21 19:57:45, sadrul wrote: > return DispatchKeyEventPostIME(key); ...
9 years, 9 months ago (2011-03-21 21:34:07 UTC) #3
oshima
1st round. Could you please add more description about the change? It'd be much easier ...
9 years, 9 months ago (2011-03-22 01:50:38 UTC) #4
James Su
http://codereview.chromium.org/6675005/diff/1/chrome/browser/ui/views/find_bar_view.cc File chrome/browser/ui/views/find_bar_view.cc (left): http://codereview.chromium.org/6675005/diff/1/chrome/browser/ui/views/find_bar_view.cc#oldcode93 chrome/browser/ui/views/find_bar_view.cc:93: #endif On 2011/03/22 01:50:39, oshima wrote: > Is it ...
9 years, 9 months ago (2011-03-22 08:41:14 UTC) #5
Ben Goodger (Google)
I made a couple of minor comments on the dependent changelists but am generally happy ...
9 years, 9 months ago (2011-03-22 20:49:30 UTC) #6
James Su
Hi all, I updated the CL to address review feedbacks. Please kindly review it again. ...
9 years, 9 months ago (2011-03-22 22:35:38 UTC) #7
Peng
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc#newcode180 views/focus/accelerator_handler_touch.cc:180: if (ime && focused_view && focused_view->GetTextInputClient()) { If the ...
9 years, 9 months ago (2011-03-24 03:58:43 UTC) #8
oshima
http://codereview.chromium.org/6675005/diff/17001/chrome/browser/chromeos/login/registration_screen.cc File chrome/browser/chromeos/login/registration_screen.cc (right): http://codereview.chromium.org/6675005/diff/17001/chrome/browser/chromeos/login/registration_screen.cc#newcode127 chrome/browser/chromeos/login/registration_screen.cc:127: views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); does this have to be reinterpret_cast? http://codereview.chromium.org/6675005/diff/17001/chrome/browser/chromeos/login/screen_locker.cc ...
9 years, 9 months ago (2011-03-24 22:58:47 UTC) #9
James Su
http://codereview.chromium.org/6675005/diff/17001/chrome/browser/chromeos/login/registration_screen.cc File chrome/browser/chromeos/login/registration_screen.cc (right): http://codereview.chromium.org/6675005/diff/17001/chrome/browser/chromeos/login/registration_screen.cc#newcode127 chrome/browser/chromeos/login/registration_screen.cc:127: views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); On 2011/03/24 22:58:47, oshima wrote: > does ...
9 years, 9 months ago (2011-03-25 05:57:20 UTC) #10
oshima
Jay, can you check focus_manager.cc change? I can't tell if this is safe or not. ...
9 years, 9 months ago (2011-03-25 17:31:25 UTC) #11
James Su
http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc File views/controls/textfield/native_textfield_views_unittest.cc (left): http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc#oldcode309 views/controls/textfield/native_textfield_views_unittest.cc:309: EXPECT_STR_EQ("my password", last_contents_); On 2011/03/25 17:31:25, oshima wrote: > ...
9 years, 9 months ago (2011-03-25 20:53:59 UTC) #12
oshima
http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc File views/controls/textfield/native_textfield_views_unittest.cc (left): http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc#oldcode309 views/controls/textfield/native_textfield_views_unittest.cc:309: EXPECT_STR_EQ("my password", last_contents_); On 2011/03/25 20:53:59, James Su wrote: ...
9 years, 9 months ago (2011-03-25 21:41:58 UTC) #13
James Su
http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc File views/controls/textfield/native_textfield_views_unittest.cc (left): http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc#oldcode309 views/controls/textfield/native_textfield_views_unittest.cc:309: EXPECT_STR_EQ("my password", last_contents_); On 2011/03/25 21:41:58, oshima wrote: > ...
9 years, 9 months ago (2011-03-25 21:48:20 UTC) #14
Jay Civelli
http://codereview.chromium.org/6675005/diff/9010/views/focus/focus_manager.cc File views/focus/focus_manager.cc (left): http://codereview.chromium.org/6675005/diff/9010/views/focus/focus_manager.cc#oldcode374 views/focus/focus_manager.cc:374: ClearFocus(); Why don't we need this anymore?
9 years, 9 months ago (2011-03-28 16:04:36 UTC) #15
James Su
http://codereview.chromium.org/6675005/diff/9010/views/focus/focus_manager.cc File views/focus/focus_manager.cc (left): http://codereview.chromium.org/6675005/diff/9010/views/focus/focus_manager.cc#oldcode374 views/focus/focus_manager.cc:374: ClearFocus(); On 2011/03/28 16:04:36, Jay Civelli wrote: > Why ...
9 years, 9 months ago (2011-03-28 16:54:12 UTC) #16
oshima
LGTM on my bits once you address below. Please make sure you address comments from ...
9 years, 9 months ago (2011-03-28 19:56:48 UTC) #17
Jay Civelli
LGTM On Mon, Mar 28, 2011 at 12:56 PM, <oshima@chromium.org> wrote: > LGTM on my ...
9 years, 9 months ago (2011-03-28 20:31:49 UTC) #18
James Su
http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc File views/controls/textfield/native_textfield_views_unittest.cc (left): http://codereview.chromium.org/6675005/diff/5046/views/controls/textfield/native_textfield_views_unittest.cc#oldcode309 views/controls/textfield/native_textfield_views_unittest.cc:309: EXPECT_STR_EQ("my password", last_contents_); On 2011/03/28 19:56:49, oshima wrote: > ...
9 years, 9 months ago (2011-03-28 21:25:33 UTC) #19
Peng
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc#newcode180 views/focus/accelerator_handler_touch.cc:180: if (ime && focused_view && focused_view->GetTextInputClient()) { Did you ...
9 years, 9 months ago (2011-03-29 03:04:46 UTC) #20
James Su
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc#newcode180 views/focus/accelerator_handler_touch.cc:180: if (ime && focused_view && focused_view->GetTextInputClient()) { On 2011/03/29 ...
9 years, 9 months ago (2011-03-29 05:00:19 UTC) #21
oshima
a few points that came to my mind. http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode933 views/controls/textfield/native_textfield_views.cc:933: return; ...
9 years, 9 months ago (2011-03-29 19:07:54 UTC) #22
James Su
http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode933 views/controls/textfield/native_textfield_views.cc:933: return; On 2011/03/29 19:07:55, oshima wrote: > can we ...
9 years, 9 months ago (2011-03-29 19:21:51 UTC) #23
oshima
http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode933 views/controls/textfield/native_textfield_views.cc:933: return; On 2011/03/29 19:21:51, James Su wrote: > On ...
9 years, 8 months ago (2011-03-30 21:06:34 UTC) #24
Peng
http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode933 views/controls/textfield/native_textfield_views.cc:933: return; We have several input_method implementations (Ibus, gtk, win, ...
9 years, 8 months ago (2011-03-30 21:28:27 UTC) #25
James Su
http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode933 views/controls/textfield/native_textfield_views.cc:933: return; On 2011/03/30 21:06:34, oshima wrote: > On 2011/03/29 ...
9 years, 8 months ago (2011-03-30 21:30:32 UTC) #26
oshima
http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode933 views/controls/textfield/native_textfield_views.cc:933: return; On 2011/03/30 21:30:32, James Su wrote: > On ...
9 years, 8 months ago (2011-03-30 21:51:25 UTC) #27
James Su
http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc File views/controls/textfield/native_textfield_views.cc (right): http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc#newcode935 views/controls/textfield/native_textfield_views.cc:935: InputMethod* input_method = textfield_->GetInputMethod(); On 2011/03/30 21:51:25, oshima wrote: ...
9 years, 8 months ago (2011-03-30 22:46:38 UTC) #28
oshima
On Wed, Mar 30, 2011 at 2:30 PM, <suzhe@chromium.org> wrote: > > > http://codereview.chromium.org/6675005/diff/39001/views/controls/textfield/native_textfield_views.cc > ...
9 years, 8 months ago (2011-03-31 17:44:17 UTC) #29
Peng
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc#newcode180 views/focus/accelerator_handler_touch.cc:180: if (ime && focused_view && focused_view->GetTextInputClient()) { On 2011/03/29 ...
9 years, 8 months ago (2011-03-31 19:18:58 UTC) #30
James Su
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc File views/focus/accelerator_handler_touch.cc (right): http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc#newcode180 views/focus/accelerator_handler_touch.cc:180: if (ime && focused_view && focused_view->GetTextInputClient()) { On 2011/03/31 ...
9 years, 8 months ago (2011-03-31 19:23:00 UTC) #31
Peng
On 2011/03/31 19:23:00, James Su wrote: > http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc > File views/focus/accelerator_handler_touch.cc (right): > > http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_handler_touch.cc#newcode180 ...
9 years, 8 months ago (2011-03-31 21:19:59 UTC) #32
Peng
9 years, 8 months ago (2011-03-31 21:22:53 UTC) #33
On 2011/03/31 21:19:59, Peng wrote:
> On 2011/03/31 19:23:00, James Su wrote:
> >
>
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_han...
> > File views/focus/accelerator_handler_touch.cc (right):
> > 
> >
>
http://codereview.chromium.org/6675005/diff/17001/views/focus/accelerator_han...
> > views/focus/accelerator_handler_touch.cc:180: if (ime && focused_view &&
> > focused_view->GetTextInputClient()) {
> > On 2011/03/31 19:18:58, Peng wrote:
> > > On 2011/03/29 05:00:20, James Su wrote:
> > > > On 2011/03/29 03:04:46, Peng wrote:
> > > > > Did you fix this?
> > Yes, it's fixed already.
> > 
> > > > > 
> > > > > On 2011/03/24 03:58:43, Peng wrote:
> > > > > > If the focused_view->GetTextInputClient() is NULL, the key event
will
> > not
> > > be
> > > > > > dispatched to input method.
> > > > > > 
> > > > > > But for ChromeOS, IME switch hotkey should work, even if the focused
> > view
> > > > does
> > > > > > not support input method. 
> > > > > 
> > > > 
> > > > Good point. I'll fix it asap.
> > > 
> > > Did you fix this one?
> 
> Thanks. I saw the code in this CL. But it still leak some code in
> InputMethodIBus for this feature.
> 
> LGTM.

Sorry. leak => lack.

Powered by Google App Engine
This is Rietveld 408576698