| Index: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
|
| diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
|
| index 19040b5fbd5a7a9b6f4bc168107a9e1793b88939..f04db66d3ce4bb76102efa5b4ce272eedea236c2 100644
|
| --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
|
| +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
|
| @@ -649,8 +649,9 @@ bool AutocompleteEditViewMac::OnAfterPossibleChange() {
|
| const std::wstring new_text(GetText());
|
| const size_t length = new_text.length();
|
|
|
| - const bool selection_differs = !NSEqualRanges(new_selection,
|
| - selection_before_change_);
|
| + const bool selection_differs =
|
| + (new_selection.length || selection_before_change_.length) &&
|
| + !NSEqualRanges(new_selection, selection_before_change_);
|
| const bool at_end_of_edit = (length == new_selection.location);
|
| const bool text_differs = (new_text != text_before_change_) ||
|
| !NSEqualRanges(marked_range_before_change_, GetMarkedRange());
|
| @@ -811,7 +812,7 @@ bool AutocompleteEditViewMac::OnDoCommandBySelector(SEL cmd) {
|
|
|
| if (cmd == @selector(insertTab:) ||
|
| cmd == @selector(insertTabIgnoringFieldEditor:)) {
|
| - if (model_->is_keyword_hint() && !model_->keyword().empty()) {
|
| + if (model_->is_keyword_hint() && controller_->IsKeywordHintVisible()) {
|
| model_->AcceptKeyword();
|
| return true;
|
| }
|
| @@ -942,8 +943,7 @@ void AutocompleteEditViewMac::OnPaste() {
|
| if ([editor shouldChangeTextInRange:selectedRange replacementString:s]) {
|
| // 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
|
|
|