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" |
17 #include "components/variations/variations_associated_data.h" | 18 #include "components/variations/variations_associated_data.h" |
18 #include "net/base/escape.h" | 19 #include "net/base/escape.h" |
19 #include "url/third_party/mozilla/url_parse.h" | 20 #include "url/third_party/mozilla/url_parse.h" |
20 #include "url/url_canon_stdstring.h" | 21 #include "url/url_canon_stdstring.h" |
21 | 22 |
22 namespace password_manager { | 23 namespace password_manager { |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 // The scheme used for identifying Android applications. | 27 // The scheme used for identifying Android applications. |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 return facet.IsValidAndroidFacetURI(); | 337 return facet.IsValidAndroidFacetURI(); |
337 } | 338 } |
338 | 339 |
339 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, | 340 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, |
340 const std::string& languages) { | 341 const std::string& languages) { |
341 password_manager::FacetURI facet_uri = | 342 password_manager::FacetURI facet_uri = |
342 password_manager::FacetURI::FromPotentiallyInvalidSpec( | 343 password_manager::FacetURI::FromPotentiallyInvalidSpec( |
343 password_form.signon_realm); | 344 password_form.signon_realm); |
344 if (facet_uri.IsValidAndroidFacetURI()) | 345 if (facet_uri.IsValidAndroidFacetURI()) |
345 return facet_uri.scheme() + "://" + facet_uri.android_package_name(); | 346 return facet_uri.scheme() + "://" + facet_uri.android_package_name(); |
346 return base::UTF16ToUTF8(net::FormatUrl(password_form.origin, languages)); | 347 return base::UTF16ToUTF8( |
| 348 url_formatter::FormatUrl(password_form.origin, languages)); |
347 } | 349 } |
| 350 |
348 } // namespace password_manager | 351 } // namespace password_manager |
OLD | NEW |