Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_edit_view_views.cc |
| diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc |
| index 2b77099e0ae567152f9a148477d215ff6de1ff83..509387387bc28fb55cb047d334c29a953523b496 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_edit_view_views.cc |
| +++ b/chrome/browser/autocomplete/autocomplete_edit_view_views.cc |
| @@ -197,10 +197,20 @@ bool AutocompleteEditViewViews::HandleAfterKeyEvent( |
| event.GetKeyCode() == ui::VKEY_TAB && |
| !event.IsShiftDown() && |
| !event.IsControlDown()) { |
| - if (model_->is_keyword_hint() && !model_->keyword().empty()) { |
| - model_->AcceptKeyword(); |
| - handled = true; |
| + if (model_->is_keyword_hint()) { |
| + handled = model_->AcceptKeyword(); |
| } else { |
| + string16::size_type start = 0; |
| + string16::size_type end = 0; |
| + size_t length = GetTextLength(); |
| + GetSelectionBounds(&start, &end); |
| + if (start != end || start < length) { |
| + OnBeforePossibleChange(); |
|
sky
2011/01/27 19:55:31
Same question about the need for OnBefore/after he
|
| + SelectRange(length, length); |
| + OnAfterPossibleChange(); |
| + handled = true; |
| + } |
|
oshima
2011/01/27 21:17:44
instant is not working on views impl and i'd rathe
James Su
2011/01/27 21:55:53
Above code is nothing to do with instant support.
|
| + |
| // TODO(Oshima): handle instant |
| } |
| } |
| @@ -527,10 +537,13 @@ CommandUpdater* AutocompleteEditViewViews::GetCommandUpdater() { |
| return command_updater_; |
| } |
| -views::View* AutocompleteEditViewViews::AddToView(views::View* parent) { |
| - parent->AddChildView(this); |
| - AddChildView(textfield_); |
| - return this; |
| +void AutocompleteEditViewViews::SetInstantSuggestion(const string16& input) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +string16 AutocompleteEditViewViews::GetInstantSuggestion() const { |
| + NOTIMPLEMENTED(); |
| + return string16(); |
| } |
| int AutocompleteEditViewViews::TextWidth() const { |
| @@ -542,15 +555,10 @@ bool AutocompleteEditViewViews::IsImeComposing() const { |
| return false; |
| } |
| -bool AutocompleteEditViewViews::CommitInstantSuggestion( |
| - const string16& typed_text, |
| - const string16& suggested_text) { |
| - model_->FinalizeInstantQuery(typed_text, suggested_text); |
| - return true; |
| -} |
| - |
| -void AutocompleteEditViewViews::SetInstantSuggestion(const string16& input) { |
| - NOTIMPLEMENTED(); |
| +views::View* AutocompleteEditViewViews::AddToView(views::View* parent) { |
| + parent->AddChildView(this); |
| + AddChildView(textfield_); |
| + return this; |
| } |
| //////////////////////////////////////////////////////////////////////////////// |