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

Issue 6281011: Allow space to accept keyword even when inline autocomplete is available. (Closed)

Created:
9 years, 11 months ago by James Su
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Allow space to accept keyword even when inline autocomplete is available. This CL assumes keyword query is always synchronous. BUG=70527 TEST=See bug report. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72457

Patch Set 1 #

Patch Set 2 : Update test to cover the new case. #

Patch Set 3 : Accept keyword even with selection. #

Total comments: 12

Patch Set 4 : Update. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -33 lines) Patch
M chrome/browser/autocomplete/autocomplete_edit.h View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.cc View 1 2 3 3 chunks +17 lines, -15 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_browsertest.cc View 1 2 4 chunks +45 lines, -16 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
James Su
9 years, 11 months ago (2011-01-24 05:16:29 UTC) #1
James Su
One point: this CL only accepts keyword when the selection is inline autocomplete. It doesn't ...
9 years, 11 months ago (2011-01-24 20:31:22 UTC) #2
Peter Kasting
On 2011/01/24 20:31:22, James Su wrote: > One point: this CL only accepts keyword when ...
9 years, 11 months ago (2011-01-24 22:12:24 UTC) #3
James Su
On 2011/01/24 22:12:24, Peter Kasting wrote: > On 2011/01/24 20:31:22, James Su wrote: > > ...
9 years, 11 months ago (2011-01-24 22:53:50 UTC) #4
Peter Kasting
On 2011/01/24 22:53:50, James Su wrote: > If the user changes the selection manually, then ...
9 years, 11 months ago (2011-01-24 23:05:08 UTC) #5
James Su
On 2011/01/24 23:05:08, Peter Kasting wrote: > On 2011/01/24 22:53:50, James Su wrote: > > ...
9 years, 11 months ago (2011-01-24 23:25:08 UTC) #6
James Su
One quick question: shall we accept keyword "foo" in such case: 1. Paste "foo bar" ...
9 years, 11 months ago (2011-01-24 23:46:07 UTC) #7
Peter Kasting
On 2011/01/24 23:46:07, James Su wrote: > One quick question: shall we accept keyword "foo" ...
9 years, 11 months ago (2011-01-24 23:47:52 UTC) #8
James Su
CL has been updated to cover the selection case.
9 years, 11 months ago (2011-01-25 01:04:36 UTC) #9
Peter Kasting
LGTM http://codereview.chromium.org/6281011/diff/4002/chrome/browser/autocomplete/autocomplete_edit.cc File chrome/browser/autocomplete/autocomplete_edit.cc (right): http://codereview.chromium.org/6281011/diff/4002/chrome/browser/autocomplete/autocomplete_edit.cc#newcode632 chrome/browser/autocomplete/autocomplete_edit.cc:632: const bool had_inline_autocomplete = !inline_autocomplete_text_.empty(); Nit: You can ...
9 years, 11 months ago (2011-01-25 02:12:21 UTC) #10
James Su
Committed. http://codereview.chromium.org/6281011/diff/4002/chrome/browser/autocomplete/autocomplete_edit.cc File chrome/browser/autocomplete/autocomplete_edit.cc (right): http://codereview.chromium.org/6281011/diff/4002/chrome/browser/autocomplete/autocomplete_edit.cc#newcode632 chrome/browser/autocomplete/autocomplete_edit.cc:632: const bool had_inline_autocomplete = !inline_autocomplete_text_.empty(); On 2011/01/25 02:12:22, ...
9 years, 11 months ago (2011-01-25 02:52:48 UTC) #11
Peter Kasting
9 years, 11 months ago (2011-01-25 04:25:48 UTC) #12
http://codereview.chromium.org/6281011/diff/4002/chrome/browser/autocomplete/...
File chrome/browser/autocomplete/autocomplete_edit.cc (right):

http://codereview.chromium.org/6281011/diff/4002/chrome/browser/autocomplete/...
chrome/browser/autocomplete/autocomplete_edit.cc:668: if (text_differs &&
allow_keyword_ui_change && !just_deleted_text &&
On 2011/01/25 02:52:48, James Su wrote:
> On 2011/01/25 02:12:22, Peter Kasting wrote:
> > Nit: Even more condensed:
> > 
> >   return !text_differs || !allow_keyword_ui_change || just_deleted_text ||
> >       !MaybeAcceptKeywordBySpace(old_user_text, user_text_);
> I'd prefer to keep the old one, which is more readable to me.

Then how about this:

  return !(text_differs && allow_keyword_ui_change && !just_deleted_text &&
      MaybeAcceptKeywordBySpace(old_user_text, user_text_));

I really don't like "if (x) return true; return false;"-type blocks.

Powered by Google App Engine
This is Rietveld 408576698