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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 523 |
524 bool AutofillPopupControllerImpl::CanAccept(int id) { | 524 bool AutofillPopupControllerImpl::CanAccept(int id) { |
525 return id != POPUP_ITEM_ID_SEPARATOR && id != POPUP_ITEM_ID_WARNING_MESSAGE; | 525 return id != POPUP_ITEM_ID_SEPARATOR && id != POPUP_ITEM_ID_WARNING_MESSAGE; |
526 } | 526 } |
527 | 527 |
528 bool AutofillPopupControllerImpl::HasSuggestions() { | 528 bool AutofillPopupControllerImpl::HasSuggestions() { |
529 return identifiers_.size() != 0 && | 529 return identifiers_.size() != 0 && |
530 (identifiers_[0] > 0 || | 530 (identifiers_[0] > 0 || |
531 identifiers_[0] == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY || | 531 identifiers_[0] == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY || |
532 identifiers_[0] == POPUP_ITEM_ID_PASSWORD_ENTRY || | 532 identifiers_[0] == POPUP_ITEM_ID_PASSWORD_ENTRY || |
533 identifiers_[0] == POPUP_ITEM_ID_DATALIST_ENTRY); | 533 identifiers_[0] == POPUP_ITEM_ID_DATALIST_ENTRY || |
| 534 identifiers_[0] == POPUP_ITEM_ID_MAC_ACCESS_CONTACTS); |
534 } | 535 } |
535 | 536 |
536 void AutofillPopupControllerImpl::SetValues( | 537 void AutofillPopupControllerImpl::SetValues( |
537 const std::vector<base::string16>& names, | 538 const std::vector<base::string16>& names, |
538 const std::vector<base::string16>& subtexts, | 539 const std::vector<base::string16>& subtexts, |
539 const std::vector<base::string16>& icons, | 540 const std::vector<base::string16>& icons, |
540 const std::vector<int>& identifiers) { | 541 const std::vector<int>& identifiers) { |
541 names_ = names; | 542 names_ = names; |
542 full_names_ = names; | 543 full_names_ = names; |
543 subtexts_ = subtexts; | 544 subtexts_ = subtexts; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 names_.clear(); | 626 names_.clear(); |
626 subtexts_.clear(); | 627 subtexts_.clear(); |
627 icons_.clear(); | 628 icons_.clear(); |
628 identifiers_.clear(); | 629 identifiers_.clear(); |
629 full_names_.clear(); | 630 full_names_.clear(); |
630 | 631 |
631 selected_line_ = kNoSelection; | 632 selected_line_ = kNoSelection; |
632 } | 633 } |
633 | 634 |
634 } // namespace autofill | 635 } // namespace autofill |
OLD | NEW |