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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 if (selected_line != kNoSelection) { | 457 if (selected_line != kNoSelection) { |
458 InvalidateRow(selected_line); | 458 InvalidateRow(selected_line); |
459 | 459 |
460 if (!CanAccept(suggestions_[selected_line].frontend_id)) | 460 if (!CanAccept(suggestions_[selected_line].frontend_id)) |
461 selected_line = kNoSelection; | 461 selected_line = kNoSelection; |
462 } | 462 } |
463 | 463 |
464 selected_line_ = selected_line; | 464 selected_line_ = selected_line; |
465 | 465 |
466 if (selected_line_ != kNoSelection) { | 466 if (selected_line_ != kNoSelection) { |
467 delegate_->DidSelectSuggestion(elided_values_[selected_line_], | 467 delegate_->DidSelectSuggestion(suggestions_[selected_line_].value, |
468 suggestions_[selected_line_].frontend_id); | 468 suggestions_[selected_line_].frontend_id); |
469 } else { | 469 } else { |
470 delegate_->ClearPreviewedForm(); | 470 delegate_->ClearPreviewedForm(); |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
474 void AutofillPopupControllerImpl::SelectNextLine() { | 474 void AutofillPopupControllerImpl::SelectNextLine() { |
475 int new_selected_line = selected_line_ + 1; | 475 int new_selected_line = selected_line_ + 1; |
476 | 476 |
477 // Skip over any lines that can't be selected. | 477 // Skip over any lines that can't be selected. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 popup_bounds_ = gfx::Rect(); | 657 popup_bounds_ = gfx::Rect(); |
658 | 658 |
659 suggestions_.clear(); | 659 suggestions_.clear(); |
660 elided_values_.clear(); | 660 elided_values_.clear(); |
661 elided_labels_.clear(); | 661 elided_labels_.clear(); |
662 | 662 |
663 selected_line_ = kNoSelection; | 663 selected_line_ = kNoSelection; |
664 } | 664 } |
665 | 665 |
666 } // namespace autofill | 666 } // namespace autofill |
OLD | NEW |