| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/password_manager/core/browser/affiliation_utils.h" | 5 #include "components/password_manager/core/browser/affiliation_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "components/autofill/core/common/password_form.h" | 15 #include "components/autofill/core/common/password_form.h" |
| 16 #include "components/password_manager/core/common/password_manager_switches.h" | 16 #include "components/password_manager/core/common/password_manager_switches.h" |
| 17 #include "components/url_formatter/url_formatter.h" | |
| 18 #include "components/variations/variations_associated_data.h" | 17 #include "components/variations/variations_associated_data.h" |
| 19 #include "net/base/escape.h" | 18 #include "net/base/escape.h" |
| 20 #include "url/third_party/mozilla/url_parse.h" | 19 #include "url/third_party/mozilla/url_parse.h" |
| 21 #include "url/url_canon_stdstring.h" | 20 #include "url/url_canon_stdstring.h" |
| 22 | 21 |
| 23 namespace password_manager { | 22 namespace password_manager { |
| 24 | 23 |
| 25 namespace { | 24 namespace { |
| 26 | 25 |
| 27 // The scheme used for identifying Android applications. | 26 // The scheme used for identifying Android applications. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 return facet.IsValidAndroidFacetURI(); | 335 return facet.IsValidAndroidFacetURI(); |
| 337 } | 336 } |
| 338 | 337 |
| 339 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, | 338 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, |
| 340 const std::string& languages) { | 339 const std::string& languages) { |
| 341 password_manager::FacetURI facet_uri = | 340 password_manager::FacetURI facet_uri = |
| 342 password_manager::FacetURI::FromPotentiallyInvalidSpec( | 341 password_manager::FacetURI::FromPotentiallyInvalidSpec( |
| 343 password_form.signon_realm); | 342 password_form.signon_realm); |
| 344 if (facet_uri.IsValidAndroidFacetURI()) | 343 if (facet_uri.IsValidAndroidFacetURI()) |
| 345 return facet_uri.scheme() + "://" + facet_uri.android_package_name(); | 344 return facet_uri.scheme() + "://" + facet_uri.android_package_name(); |
| 346 return base::UTF16ToUTF8( | 345 return base::UTF16ToUTF8(net::FormatUrl(password_form.origin, languages)); |
| 347 url_formatter::FormatUrl(password_form.origin, languages)); | |
| 348 } | 346 } |
| 349 | |
| 350 } // namespace password_manager | 347 } // namespace password_manager |
| OLD | NEW |