| 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/password_manager/password_store_mac.h" | 5 #include "chrome/browser/password_manager/password_store_mac.h" |
| 6 #include "chrome/browser/password_manager/password_store_mac_internal.h" | 6 #include "chrome/browser/password_manager/password_store_mac_internal.h" |
| 7 | 7 |
| 8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // The signon_realm will be the Origin portion of a URL for an HTML form, | 600 // The signon_realm will be the Origin portion of a URL for an HTML form, |
| 601 // and the same but with the security domain as a path for HTTP auth. | 601 // and the same but with the security domain as a path for HTTP auth. |
| 602 GURL realm_as_url(signon_realm); | 602 GURL realm_as_url(signon_realm); |
| 603 if (!realm_as_url.is_valid()) { | 603 if (!realm_as_url.is_valid()) { |
| 604 return false; | 604 return false; |
| 605 } | 605 } |
| 606 | 606 |
| 607 if (server) | 607 if (server) |
| 608 *server = realm_as_url.host(); | 608 *server = realm_as_url.host(); |
| 609 if (is_secure) | 609 if (is_secure) |
| 610 *is_secure = realm_as_url.SchemeIsSecure(); | 610 *is_secure = realm_as_url.SchemeIsCryptographic(); |
| 611 if (port) | 611 if (port) |
| 612 *port = realm_as_url.has_port() ? atoi(realm_as_url.port().c_str()) : 0; | 612 *port = realm_as_url.has_port() ? atoi(realm_as_url.port().c_str()) : 0; |
| 613 if (security_domain) { | 613 if (security_domain) { |
| 614 // Strip the leading '/' off of the path to get the security domain. | 614 // Strip the leading '/' off of the path to get the security domain. |
| 615 if (realm_as_url.path().length() > 0) | 615 if (realm_as_url.path().length() > 0) |
| 616 *security_domain = realm_as_url.path().substr(1); | 616 *security_domain = realm_as_url.path().substr(1); |
| 617 else | 617 else |
| 618 security_domain->clear(); | 618 security_domain->clear(); |
| 619 } | 619 } |
| 620 return true; | 620 return true; |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 ScopedVector<PasswordForm> forms_with_keychain_entry; | 1218 ScopedVector<PasswordForm> forms_with_keychain_entry; |
| 1219 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, | 1219 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, |
| 1220 &forms_with_keychain_entry); | 1220 &forms_with_keychain_entry); |
| 1221 | 1221 |
| 1222 // Clean up any orphaned database entries. | 1222 // Clean up any orphaned database entries. |
| 1223 RemoveDatabaseForms(&database_forms); | 1223 RemoveDatabaseForms(&database_forms); |
| 1224 | 1224 |
| 1225 // Move the orphaned DB forms to the output parameter. | 1225 // Move the orphaned DB forms to the output parameter. |
| 1226 AppendSecondToFirst(orphaned_forms, &database_forms); | 1226 AppendSecondToFirst(orphaned_forms, &database_forms); |
| 1227 } | 1227 } |
| OLD | NEW |