OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 InvalidateRow(selected_line); | 483 InvalidateRow(selected_line); |
484 | 484 |
485 if (!CanAccept(suggestions_[selected_line].frontend_id)) | 485 if (!CanAccept(suggestions_[selected_line].frontend_id)) |
486 selected_line = kNoSelection; | 486 selected_line = kNoSelection; |
487 } | 487 } |
488 | 488 |
489 selected_line_ = selected_line; | 489 selected_line_ = selected_line; |
490 | 490 |
491 if (selected_line_ != kNoSelection) { | 491 if (selected_line_ != kNoSelection) { |
492 delegate_->DidSelectSuggestion(suggestions_[selected_line_].value, | 492 delegate_->DidSelectSuggestion(suggestions_[selected_line_].value, |
493 suggestions_[selected_line_].frontend_id); | 493 suggestions_[selected_line_].frontend_id, |
| 494 suggestions_[selected_line_].match_start); |
494 } else { | 495 } else { |
495 delegate_->ClearPreviewedForm(); | 496 delegate_->ClearPreviewedForm(); |
496 } | 497 } |
497 } | 498 } |
498 | 499 |
499 void AutofillPopupControllerImpl::SelectNextLine() { | 500 void AutofillPopupControllerImpl::SelectNextLine() { |
500 int new_selected_line = selected_line_ + 1; | 501 int new_selected_line = selected_line_ + 1; |
501 | 502 |
502 // Skip over any lines that can't be selected. | 503 // Skip over any lines that can't be selected. |
503 while (static_cast<size_t>(new_selected_line) < GetLineCount() && | 504 while (static_cast<size_t>(new_selected_line) < GetLineCount() && |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 popup_bounds_ = gfx::Rect(); | 662 popup_bounds_ = gfx::Rect(); |
662 | 663 |
663 suggestions_.clear(); | 664 suggestions_.clear(); |
664 elided_values_.clear(); | 665 elided_values_.clear(); |
665 elided_labels_.clear(); | 666 elided_labels_.clear(); |
666 | 667 |
667 selected_line_ = kNoSelection; | 668 selected_line_ = kNoSelection; |
668 } | 669 } |
669 | 670 |
670 } // namespace autofill | 671 } // namespace autofill |
OLD | NEW |