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

Issue 6036004: Refactor AutocompleteEditViewGtk so that AutocompleteEditView impl can be swapped. (Closed)

Created:
9 years, 12 months ago by oshima
Modified:
9 years, 6 months ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

I'm working on autocomplete edit view which does not use native controls for Chromeos and Touch UI. The goal of this refactoring is to make it easy to swap AutocompleteEditView implementation between Gtk based impl and Views based one. This is 1st phrase and there will be more refacotring needed to implement AutocompleteEditViewViews. - Added factory method AutocompleteEditViewGtk::Create, which hides initialization details for gtk based impl. - Moved gtk specific accessibilty code to AutocompleteEditViewGtk. - Added TOOLKIT_VIWES only methods to AutocompleteEditView to hide platform specific implementation. (AddToView, CommitInstatntSuggestion/SetInstantSuggestion) BUG=none TEST=none no functional change. all tests should pass. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70746

Patch Set 1 #

Patch Set 2 : " #

Patch Set 3 : " #

Total comments: 28

Patch Set 4 : " #

Patch Set 5 : " #

Total comments: 8

Patch Set 6 : " #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -100 lines) Patch
M chrome/browser/autocomplete/autocomplete_edit_unittest.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view.h View 1 2 3 4 5 2 chunks +23 lines, -1 line 10 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_gtk.h View 1 2 3 4 5 4 chunks +30 lines, -8 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc View 1 2 3 4 5 3 chunks +100 lines, -40 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_win.h View 1 2 3 4 5 3 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_win.cc View 1 2 3 4 5 4 chunks +27 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.h View 1 2 3 4 chunks +4 lines, -9 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 4 5 4 chunks +11 lines, -30 lines 2 comments Download

Messages

Total messages: 14 (0 generated)
oshima
9 years, 11 months ago (2011-01-06 01:45:04 UTC) #1
Peter Kasting
http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc (right): http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc#newcode796 chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc:796: views::View* AutocompleteEditViewGtk::AddToView(views::View* parent) { Nit: This function is the ...
9 years, 11 months ago (2011-01-06 02:06:48 UTC) #2
James Su
I'll review this CL asap. Just FYI: I'm working on http://codereview.chromium.org/5966006 which may conflict with ...
9 years, 11 months ago (2011-01-06 02:24:16 UTC) #3
dmazzoni
http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc (right): http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc#newcode845 chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc:845: autocomplete->CreateAccessibleWidgetHelper(IDS_ACCNAME_LOCATION); Why should this be a separate step? Could ...
9 years, 11 months ago (2011-01-06 15:03:03 UTC) #4
oshima
http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc (right): http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc#newcode796 chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc:796: views::View* AutocompleteEditViewGtk::AddToView(views::View* parent) { On 2011/01/06 02:06:48, Peter Kasting ...
9 years, 11 months ago (2011-01-06 19:43:35 UTC) #5
Peter Kasting
LGTM http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc (right): http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc#newcode796 chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc:796: views::View* AutocompleteEditViewGtk::AddToView(views::View* parent) { On 2011/01/06 19:43:35, oshima ...
9 years, 11 months ago (2011-01-06 20:51:38 UTC) #6
oshima
Thank you for review. I'll wait for comments from James and Dominic. http://codereview.chromium.org/6036004/diff/27001/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc File chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc ...
9 years, 11 months ago (2011-01-06 21:39:26 UTC) #7
dmazzoni
LGTM On Thu, Jan 6, 2011 at 11:43 AM, <oshima@chromium.org> wrote: > On 2011/01/06 15:03:03, ...
9 years, 11 months ago (2011-01-06 22:21:39 UTC) #8
James Su
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h File chrome/browser/autocomplete/autocomplete_edit_view.h (right): http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h#newcode168 chrome/browser/autocomplete/autocomplete_edit_view.h:168: const std::wstring& suggested_text) = 0; The implementation of this ...
9 years, 11 months ago (2011-01-06 23:01:34 UTC) #9
oshima
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h File chrome/browser/autocomplete/autocomplete_edit_view.h (right): http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h#newcode168 chrome/browser/autocomplete/autocomplete_edit_view.h:168: const std::wstring& suggested_text) = 0; On 2011/01/06 23:01:35, James ...
9 years, 11 months ago (2011-01-06 23:32:45 UTC) #10
James Su
And how about to remove the parameter of AutocompleteEditController::OnCommitSuggestedText() method? http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h File chrome/browser/autocomplete/autocomplete_edit_view.h (right): http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h#newcode168 ...
9 years, 11 months ago (2011-01-06 23:49:08 UTC) #11
oshima
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h File chrome/browser/autocomplete/autocomplete_edit_view.h (right): http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete/autocomplete_edit_view.h#newcode168 chrome/browser/autocomplete/autocomplete_edit_view.h:168: const std::wstring& suggested_text) = 0; On 2011/01/06 23:49:08, James ...
9 years, 11 months ago (2011-01-07 01:49:39 UTC) #12
James Su
LGTM, as long as you'll do further refactory soon. On 2011/01/07 01:49:39, oshima wrote: > ...
9 years, 11 months ago (2011-01-07 02:28:31 UTC) #13
oshima
9 years, 11 months ago (2011-01-07 02:33:35 UTC) #14
On Thu, Jan 6, 2011 at 6:28 PM, <suzhe@chromium.org> wrote:

> LGTM, as long as you'll do further refactory soon.
>
>
Thanks. I'll continue working on it and well include you in reviewers.

- oshima


>
> On 2011/01/07 01:49:39, oshima wrote:
>
>
>
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete...
>
>> File chrome/browser/autocomplete/autocomplete_edit_view.h (right):
>>
>
>
>
>
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete...
>
>> chrome/browser/autocomplete/autocomplete_edit_view.h:168: const
>> std::wstring&
>> suggested_text) = 0;
>> On 2011/01/06 23:49:08, James Su wrote:
>> > On 2011/01/06 23:32:45, oshima wrote:
>> > > On 2011/01/06 23:01:35, James Su wrote:
>> > > > The implementation of this method on all platforms should be same.
>> Actually,
>> > > the
>> > > > current implementation is just a call to
>>
> model()->FinalizeInstantQuery().
>
>> So
>> > > > maybe it's better to remove this method from all implementations and
>>
> just
>
>> > call
>> > > > FinalizeInstantQuery() in location bar view. Then the only thing we
>> need
>> for
>> > > > this View interface is a GetInstantSuggestText() method. Maybe we
>> can
>>
> add
>
>> a
>> > > same
>> > > > method to AutocompleteEditController interface and provide different
>> > > > implementations in location bar classes.
>> > > > What's your opinion about it?
>> > >
>> > > I really like the idea to have the same implementation, but I need to
>> look
>> > into
>> > > more before
>> > > making big changes to it. I'm planning to move suggested_text_view to
>> > > AutocompleteEditView impl,
>> > > which matches other platforms impl, and it will have some impact on
>> this
>> > change
>> > > too, so
>> > > I'd like to defer it to future refactoring.
>> >
>> > Then I'd prefer not to refactor this part for now. It's not worth to add
>>
> this
>
>> > method temporarily if we are going to remove it later.
>>
>
>  I can't eliminate Gtk's type without common method. It's pertty common to
>> add/update/remove methods during refactoring (and you'll never know the
>> final
>> form until you finish it), so I think it's okay to add this now even if we
>> may
>> modify it later.
>>
>
>
>  > And I'm wondering how would you move suggest_text_view into the
>> > AutocompleteEditView's impl? It seems not doable for
>>
> AutocompleteEditViewWin.
>
>  It's possible. Whether or not it will be LGTM by scott is different story
>>
> though
>
>> :) I think it's good move because it will make all implementation
>> consistent
>> (mac and gtk has this info inside AutocompleteEditView, and Views impl
>> will be
>> the same).
>>
>
>
>
>
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete...
>
>> chrome/browser/autocomplete/autocomplete_edit_view.h:171: virtual void
>> SetInstantSuggestion(const string16& input) = 0;
>> On 2011/01/06 23:49:08, James Su wrote:
>> > It's probably better to generalize this method for all platforms as
>> well.
>>
> Mac
>
>> > port has SetSuggestText() for the same purpose.
>>
>
>  Good idea. I'll do it, but in separate CL. I'd like to avoid touching mac
>> file
>> in this CL.
>>
>
>
>
>
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/autocomplete...
>
>> chrome/browser/autocomplete/autocomplete_edit_view.h:175: virtual int
>> TextWidth() const = 0;
>> On 2011/01/06 23:49:08, James Su wrote:
>> > On 2011/01/06 23:32:45, oshima wrote:
>> > > On 2011/01/06 23:01:35, James Su wrote:
>> > > > How about move it out of the #if block? It's necessary for both
>> Views
>>
> and
>
>> > Gtk
>> > > > ports.
>> > >
>> > > I didn't do so because mac doesn't have it. I can add NOTREACHED impl
>> to
>>
> mac
>
>> > if
>> > > you want. Please let me know.
>> > >
>> > I'd prefer to move it out of the #if block, as Gtk port also has it.
>>
>
>  Ok, but let me do it in separate CL, same reason as above.
>>
>
>
>
>
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/ui/views/loc...
>
>> File chrome/browser/ui/views/location_bar/location_bar_view.cc (right):
>>
>
>
>
>
http://codereview.chromium.org/6036004/diff/45001/chrome/browser/ui/views/loc...
>
>> chrome/browser/ui/views/location_bar/location_bar_view.cc:770: bool
>> LocationBarView::OnCommitSuggestedText(const std::wstring& typed_text) {
>> On 2011/01/06 23:01:35, James Su wrote:
>> > How about remove this method's parameter? The typed text can always be
>> retrieved
>> > by calling location_entry_->GetText().
>>
>
>  Which assumes that controller has these information, which is not a part
>> of
>> AutocompleteEditController contract, so I don't think it's good idea.
>>
>
>  Let me proceed step by step. I like your idea to use same code to commit
>>
> change
>
>> but I need to
>> digest the code a bit more.
>>
>
>
>
> http://codereview.chromium.org/6036004/
>

Powered by Google App Engine
This is Rietveld 408576698