summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/passwords_private
diff options
context:
space:
mode:
authormkwst <mkwst@chromium.org>2016-02-25 22:46:22 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-26 06:47:35 +0000
commit0604e9e30c88836aaab577189b7c1f19f2ab55d8 (patch)
treedc8f79824bf7f9bd7bc2eb4de3da4815be95d9da /chrome/browser/extensions/api/passwords_private
parent84b8e54216a4df727934d61ecd483e2edd0d5d58 (diff)
downloadchromium_src-0604e9e30c88836aaab577189b7c1f19f2ab55d8.zip
chromium_src-0604e9e30c88836aaab577189b7c1f19f2ab55d8.tar.gz
chromium_src-0604e9e30c88836aaab577189b7c1f19f2ab55d8.tar.bz2
CREDENTIAL: Convert federations from URLs to origins throughout.
We've been loosely treating federations as URLs, as it was simple and easy. That laxness, however, has caused some issues with the Android integration, as they are doing exact string comparisons as opposed to origin comparisons. In particular, they expect the serialization stored to sync to exclude the trailing '/'. This patch converts the field to an origin throughout, which ensures both that the serialization matches Android's expectations, but also that we're properly excluding paths and etc. from the comparisons we make in various places in the codebase. BUG=589016 R=vabr@chromium.org, vasilii@chromium.org, jochen@chromium.org TBR=marq@chromium.org Review URL: https://codereview.chromium.org/1723583004 Cr-Commit-Position: refs/heads/master@{#377834}
Diffstat (limited to 'chrome/browser/extensions/api/passwords_private')
-rw-r--r--chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
index b9a05db..09a3a99 100644
--- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
+++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc
@@ -171,11 +171,10 @@ void PasswordsPrivateDelegateImpl::SetPasswordList(
entry->login_pair.username = base::UTF16ToUTF8(form->username_value);
entry->num_characters_in_password = form->password_value.length();
- const GURL& federation_url = form->federation_url;
- if (!federation_url.is_empty()) {
+ if (!form->federation_origin.unique()) {
entry->federation_text.reset(new std::string(l10n_util::GetStringFUTF8(
IDS_PASSWORDS_VIA_FEDERATION,
- base::UTF8ToUTF16(federation_url.host_piece()))));
+ base::UTF8ToUTF16(form->federation_origin.host()))));
}
current_entries_.push_back(entry);