|
|
Created:
9 years, 1 month ago by jennyz Modified:
9 years, 1 month ago CC:
chromium-reviews, tfarina, dhollowa Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionFix the double/tripple click behavior of NataiveTextfieldViews on aura.
BUG=101774
TEST=NONE
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=109535
Patch Set 1 #
Total comments: 4
Patch Set 2 : Address the code review comments. #
Total comments: 4
Patch Set 3 : Fix minor code style issue. #
Total comments: 1
Patch Set 4 : Fix the RTL unit test failure. #
Total comments: 6
Patch Set 5 : Add a comment for code review comments. #
Messages
Total messages: 19 (0 generated)
http://codereview.chromium.org/8524008/diff/1/views/metrics_aura.cc File views/metrics_aura.cc (right): http://codereview.chromium.org/8524008/diff/1/views/metrics_aura.cc#newcode18 views/metrics_aura.cc:18: // TODO(jennyz): This value may need to be adjusted on different platform. platform -> platforms http://codereview.chromium.org/8524008/diff/1/views/view_aura.cc File views/view_aura.cc (right): http://codereview.chromium.org/8524008/diff/1/views/view_aura.cc#newcode16 views/view_aura.cc:16: return 8; platform -> platforms
I'd prefer to see these magic numbers as local constants defined in anonymous namespaces. Then GetVerticalDragThreshold can return the same kDragThreshold rather than call GetHorizontalDragThreshold.
On 2011/11/10 20:30:57, msw wrote: > I'd prefer to see these magic numbers as local constants defined in anonymous > namespaces. Then GetVerticalDragThreshold can return the same kDragThreshold > rather than call GetHorizontalDragThreshold. Done
http://codereview.chromium.org/8524008/diff/1/views/metrics_aura.cc File views/metrics_aura.cc (right): http://codereview.chromium.org/8524008/diff/1/views/metrics_aura.cc#newcode18 views/metrics_aura.cc:18: // TODO(jennyz): This value may need to be adjusted on different platform. On 2011/11/10 20:18:11, sky wrote: > platform -> platforms Done. http://codereview.chromium.org/8524008/diff/1/views/view_aura.cc File views/view_aura.cc (right): http://codereview.chromium.org/8524008/diff/1/views/view_aura.cc#newcode16 views/view_aura.cc:16: return 8; On 2011/11/10 20:18:11, sky wrote: > platform -> platforms Done.
LGTM http://codereview.chromium.org/8524008/diff/6001/views/metrics_aura.cc File views/metrics_aura.cc (right): http://codereview.chromium.org/8524008/diff/6001/views/metrics_aura.cc#newcode12 views/metrics_aura.cc:12: // Default double click interval in milliseconds. nit: newline between 11 and 12. http://codereview.chromium.org/8524008/diff/6001/views/view_aura.cc File views/view_aura.cc (right): http://codereview.chromium.org/8524008/diff/6001/views/view_aura.cc#newcode8 views/view_aura.cc:8: // Default horizontal drag threshold in pixels. nit: newline between 7 and 8
http://codereview.chromium.org/8524008/diff/6001/views/metrics_aura.cc File views/metrics_aura.cc (right): http://codereview.chromium.org/8524008/diff/6001/views/metrics_aura.cc#newcode12 views/metrics_aura.cc:12: // Default double click interval in milliseconds. On 2011/11/10 21:37:03, sky wrote: > nit: newline between 11 and 12. Done. http://codereview.chromium.org/8524008/diff/6001/views/view_aura.cc File views/view_aura.cc (right): http://codereview.chromium.org/8524008/diff/6001/views/view_aura.cc#newcode8 views/view_aura.cc:8: // Default horizontal drag threshold in pixels. On 2011/11/10 21:37:03, sky wrote: > nit: newline between 7 and 8 Done.
http://codereview.chromium.org/8524008/diff/2002/views/view_aura.cc File views/view_aura.cc (right): http://codereview.chromium.org/8524008/diff/2002/views/view_aura.cc#newcode27 views/view_aura.cc:27: return GetHorizontalDragThreshold(); nit: Make the const independent of vertical or horizontal and just return the const value here.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jennyz@chromium.org/8524008/2002
Change committed as 109535
The cl has been committed then reverted due to the RTL unit test failure on win_aura. Fix the test now.
http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... File views/controls/textfield/native_textfield_views_unittest.cc (right): http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... views/controls/textfield/native_textfield_views_unittest.cc:1541: base::PlatformThread::Sleep(1000); See the code around line 1377 in NativeTextfieldViewsTest, HitInsideTextAreaTest that calls NonClientMouseClick to avoid double click. // To avoid trigger double click. Not using sleep() since it takes longer // for the test to run if using sleep(). NonClientMouseClick();
http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... File views/controls/textfield/native_textfield_views_unittest.cc (right): http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... views/controls/textfield/native_textfield_views_unittest.cc:1541: base::PlatformThread::Sleep(1000); On 2011/11/12 00:09:08, msw wrote: > See the code around line 1377 in NativeTextfieldViewsTest, HitInsideTextAreaTest > that calls NonClientMouseClick to avoid double click. > > // To avoid trigger double click. Not using sleep() since it takes longer > // for the test to run if using sleep(). > NonClientMouseClick(); I tried NonClientMouseClick() first, but it does not work here, it was still considered as a double click. I discussed with Xiaomei, she thinks it is ok to see sleep here.
lgtm. http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... File views/controls/textfield/native_textfield_views_unittest.cc (right): http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... views/controls/textfield/native_textfield_views_unittest.cc:1541: base::PlatformThread::Sleep(1000); On 2011/11/12 00:13:35, jennyz wrote: > On 2011/11/12 00:09:08, msw wrote: > > See the code around line 1377 in NativeTextfieldViewsTest, > HitInsideTextAreaTest > > that calls NonClientMouseClick to avoid double click. > > > > // To avoid trigger double click. Not using sleep() since it takes longer > > // for the test to run if using sleep(). > > NonClientMouseClick(); > I tried NonClientMouseClick() first, but it does not work here, it was still > considered as a double click. I discussed with Xiaomei, she thinks it is ok to > see sleep here. I tried sleep() before but that makes a test (with while loop) takes longer to run https://cs.corp.google.com/#chrome/src/views/controls/textfield/native_textfi... I think it is ok for this case. But we probably need to check why NonClientClick does not work here.
http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... File views/controls/textfield/native_textfield_views_unittest.cc (right): http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... views/controls/textfield/native_textfield_views_unittest.cc:1541: base::PlatformThread::Sleep(1000); On 2011/11/12 01:26:32, xji wrote: > On 2011/11/12 00:13:35, jennyz wrote: > > On 2011/11/12 00:09:08, msw wrote: > > > See the code around line 1377 in NativeTextfieldViewsTest, > > HitInsideTextAreaTest > > > that calls NonClientMouseClick to avoid double click. > > > > > > // To avoid trigger double click. Not using sleep() since it takes longer > > > // for the test to run if using sleep(). > > > NonClientMouseClick(); > > I tried NonClientMouseClick() first, but it does not work here, it was still > > considered as a double click. I discussed with Xiaomei, she thinks it is ok to > > see sleep here. > > I tried sleep() before but that makes a test (with while loop) takes longer to > run > https://cs.corp.google.com/#chrome/src/views/controls/textfield/native_textfi... > > I think it is ok for this case. > But we probably need to check why NonClientClick does not work here. I'd prefer that we fix NonClientClick first; but if we must make this hack, please file a bug and add a comment with the bug number here.
http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... File views/controls/textfield/native_textfield_views_unittest.cc (right): http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... views/controls/textfield/native_textfield_views_unittest.cc:1541: base::PlatformThread::Sleep(1000); On 2011/11/12 02:02:45, msw wrote: > On 2011/11/12 01:26:32, xji wrote: > > On 2011/11/12 00:13:35, jennyz wrote: > > > On 2011/11/12 00:09:08, msw wrote: > > > > See the code around line 1377 in NativeTextfieldViewsTest, > > > HitInsideTextAreaTest > > > > that calls NonClientMouseClick to avoid double click. > > > > > > > > // To avoid trigger double click. Not using sleep() since it takes longer > > > > // for the test to run if using sleep(). > > > > NonClientMouseClick(); > > > I tried NonClientMouseClick() first, but it does not work here, it was still > > > considered as a double click. I discussed with Xiaomei, she thinks it is ok > to > > > see sleep here. > > > > I tried sleep() before but that makes a test (with while loop) takes longer to > > run > > > https://cs.corp.google.com/#chrome/src/views/controls/textfield/native_textfi... > > > > I think it is ok for this case. > > But we probably need to check why NonClientClick does not work here. > > I'd prefer that we fix NonClientClick first; but if we must make this hack, > please file a bug and add a comment with the bug number here. Done. Filed a bug for NonClientMouseClick. http://crbug.com/104150.
LGTM with one nit if tests pass now. http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... File views/controls/textfield/native_textfield_views_unittest.cc (right): http://codereview.chromium.org/8524008/diff/10001/views/controls/textfield/na... views/controls/textfield/native_textfield_views_unittest.cc:1541: base::PlatformThread::Sleep(1000); > Filed a bug for NonClientMouseClick. http://crbug.com/104150. Please add a comment here with that bug number. |