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 "components/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 address_form_event_logger_->set_is_local_data_available( | 1316 address_form_event_logger_->set_is_local_data_available( |
1317 is_local_data_available); | 1317 is_local_data_available); |
1318 } | 1318 } |
1319 | 1319 |
1320 if (profiles.empty() && credit_cards.empty()) | 1320 if (profiles.empty() && credit_cards.empty()) |
1321 return false; | 1321 return false; |
1322 | 1322 |
1323 return true; | 1323 return true; |
1324 } | 1324 } |
1325 | 1325 |
1326 bool AutofillManager::IsCreditCard(int unique_id) { | |
1327 // Unpack the |unique_id| into component parts. | |
1328 std::string credit_card_id; | |
1329 std::string profile_id; | |
1330 SplitFrontendID(unique_id, &credit_card_id, &profile_id); | |
1331 DCHECK(!base::IsValidGUID(credit_card_id) || !base::IsValidGUID(profile_id)); | |
1332 return base::IsValidGUID(credit_card_id); | |
1333 } | |
1334 | |
1335 bool AutofillManager::GetProfile(int unique_id, | 1326 bool AutofillManager::GetProfile(int unique_id, |
1336 const AutofillProfile** profile) { | 1327 const AutofillProfile** profile) { |
1337 // Unpack the |unique_id| into component parts. | 1328 // Unpack the |unique_id| into component parts. |
1338 std::string credit_card_id; | 1329 std::string credit_card_id; |
1339 std::string profile_id; | 1330 std::string profile_id; |
1340 SplitFrontendID(unique_id, &credit_card_id, &profile_id); | 1331 SplitFrontendID(unique_id, &credit_card_id, &profile_id); |
1341 *profile = NULL; | 1332 *profile = NULL; |
1342 if (base::IsValidGUID(profile_id)) | 1333 if (base::IsValidGUID(profile_id)) |
1343 *profile = personal_data_->GetProfileByGUID(profile_id); | 1334 *profile = personal_data_->GetProfileByGUID(profile_id); |
1344 return !!*profile; | 1335 return !!*profile; |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 if (i > 0) | 1988 if (i > 0) |
1998 fputs("Next oldest form:\n", file); | 1989 fputs("Next oldest form:\n", file); |
1999 } | 1990 } |
2000 fputs("\n", file); | 1991 fputs("\n", file); |
2001 | 1992 |
2002 fclose(file); | 1993 fclose(file); |
2003 } | 1994 } |
2004 #endif // ENABLE_FORM_DEBUG_DUMP | 1995 #endif // ENABLE_FORM_DEBUG_DUMP |
2005 | 1996 |
2006 } // namespace autofill | 1997 } // namespace autofill |
OLD | NEW |