Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_edit_view_win.cc |
| diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc |
| index 376c18e246313faf21cce35ce80dbcb854ff28ee..76a873d4a24dca6139e0de28bc1aece3475a6524 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc |
| +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc |
| @@ -861,8 +861,11 @@ bool AutocompleteEditViewWin::OnAfterPossibleChangeInternal( |
| new_sel.cpMax = length; |
| SetSelectionRange(new_sel); |
| } |
| - const bool selection_differs = (new_sel.cpMin != sel_before_change_.cpMin) || |
| - (new_sel.cpMax != sel_before_change_.cpMax); |
| + const bool selection_differs = |
| + ((new_sel.cpMin != new_sel.cpMax) || |
|
Peter Kasting
2011/01/20 00:04:22
Nit: I suggest using a similar addition to this in
James Su
2011/01/20 06:49:31
Done.
|
| + (sel_before_change_.cpMin != sel_before_change_.cpMax)) && |
| + ((new_sel.cpMin != sel_before_change_.cpMin) || |
| + (new_sel.cpMax != sel_before_change_.cpMax)); |
| const bool at_end_of_edit = |
| (new_sel.cpMin == length) && (new_sel.cpMax == length); |
| @@ -1692,8 +1695,7 @@ void AutocompleteEditViewWin::OnPaste() { |
| if (!text.empty()) { |
| // If this paste will be replacing all the text, record that, so we can do |
| // different behaviors in such a case. |
| - if (IsSelectAll()) |
| - model_->on_paste_replacing_all(); |
| + model_->OnPaste(IsSelectAll()); |
| // Force a Paste operation to trigger the text_changed code in |
| // OnAfterPossibleChange(), even if identical contents are pasted into the |
| // text box. |
| @@ -1972,7 +1974,7 @@ bool AutocompleteEditViewWin::OnKeyDownOnlyWritable(TCHAR key, |
| } |
| case VK_TAB: { |
| - if (model_->is_keyword_hint() && !model_->keyword().empty()) { |
| + if (model_->is_keyword_hint()) { |
| // Accept the keyword. |
| ScopedFreeze freeze(this, GetTextObjectModel()); |
| model_->AcceptKeyword(); |