| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/passwords/password_manager_presenter.h" | 5 #include "chrome/browser/ui/passwords/password_manager_presenter.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 origin, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 90 origin, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| 91 if (site_name.empty()) // e.g. localhost. | 91 if (site_name.empty()) // e.g. localhost. |
| 92 site_name = origin; | 92 site_name = origin; |
| 93 std::string key = site_name + password_manager::SplitByDotAndReverse(origin); | 93 std::string key = site_name + password_manager::SplitByDotAndReverse(origin); |
| 94 | 94 |
| 95 if (entry_type == PasswordEntryType::SAVED) { | 95 if (entry_type == PasswordEntryType::SAVED) { |
| 96 key += kSortKeyPartsSeparator + base::UTF16ToUTF8(form.username_value) + | 96 key += kSortKeyPartsSeparator + base::UTF16ToUTF8(form.username_value) + |
| 97 kSortKeyPartsSeparator + base::UTF16ToUTF8(form.password_value); | 97 kSortKeyPartsSeparator + base::UTF16ToUTF8(form.password_value); |
| 98 | 98 |
| 99 key += kSortKeyPartsSeparator; | 99 key += kSortKeyPartsSeparator; |
| 100 if (!form.federation_origin.unique()) | 100 if (!form.federation_origin.opaque()) |
| 101 key += form.federation_origin.host(); | 101 key += form.federation_origin.host(); |
| 102 else | 102 else |
| 103 key += kSortKeyNoFederationSymbol; | 103 key += kSortKeyNoFederationSymbol; |
| 104 } | 104 } |
| 105 | 105 |
| 106 // To separate HTTP/HTTPS credentials, add the scheme to the key. | 106 // To separate HTTP/HTTPS credentials, add the scheme to the key. |
| 107 key += kSortKeyPartsSeparator + link_url.scheme(); | 107 key += kSortKeyPartsSeparator + link_url.scheme(); |
| 108 | 108 |
| 109 // Since Android and non-Android entries shouldn't be merged into one entry, | 109 // Since Android and non-Android entries shouldn't be merged into one entry, |
| 110 // add the entry type code to the sort key. | 110 // add the entry type code to the sort key. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 void PasswordManagerPresenter::PasswordExceptionListPopulater:: | 394 void PasswordManagerPresenter::PasswordExceptionListPopulater:: |
| 395 OnGetPasswordStoreResults( | 395 OnGetPasswordStoreResults( |
| 396 std::vector<std::unique_ptr<autofill::PasswordForm>> results) { | 396 std::vector<std::unique_ptr<autofill::PasswordForm>> results) { |
| 397 page_->password_exception_list_ = std::move(results); | 397 page_->password_exception_list_ = std::move(results); |
| 398 page_->SortEntriesAndHideDuplicates(&page_->password_exception_list_, | 398 page_->SortEntriesAndHideDuplicates(&page_->password_exception_list_, |
| 399 &page_->password_exception_duplicates_, | 399 &page_->password_exception_duplicates_, |
| 400 PasswordEntryType::BLACKLISTED); | 400 PasswordEntryType::BLACKLISTED); |
| 401 page_->SetPasswordExceptionList(); | 401 page_->SetPasswordExceptionList(); |
| 402 } | 402 } |
| OLD | NEW |