Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Side by Side Diff: chrome/browser/autofill/personal_data_manager.cc

Issue 3806008: Never allow empty preview entries. As some data is always present (we drop co... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/autofill/personal_data_manager.h" 5 #include "chrome/browser/autofill/personal_data_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 case AUTOFILL_CREDITCARDS_RESULT: 80 case AUTOFILL_CREDITCARDS_RESULT:
81 ReceiveLoadedCreditCards(h, result); 81 ReceiveLoadedCreditCards(h, result);
82 break; 82 break;
83 default: 83 default:
84 NOTREACHED(); 84 NOTREACHED();
85 } 85 }
86 86
87 // If both requests have responded, then all personal data is loaded. 87 // If both requests have responded, then all personal data is loaded.
88 if (pending_profiles_query_ == 0 && pending_creditcards_query_ == 0) { 88 if (pending_profiles_query_ == 0 && pending_creditcards_query_ == 0) {
89 is_data_loaded_ = true; 89 is_data_loaded_ = true;
90 std::vector<AutoFillProfile*> profile_pointers(web_profiles_.size());
91 std::copy(web_profiles_.begin(), web_profiles_.end(),
92 profile_pointers.begin());
93 AutoFillProfile::AdjustInferredLabels(&profile_pointers);
90 FOR_EACH_OBSERVER(Observer, observers_, OnPersonalDataLoaded()); 94 FOR_EACH_OBSERVER(Observer, observers_, OnPersonalDataLoaded());
91 } 95 }
92 } 96 }
93 97
94 ///////////////////////////////////////////////////////////////////////////// 98 /////////////////////////////////////////////////////////////////////////////
95 // PersonalDataManager, 99 // PersonalDataManager,
96 // views::ButtonListener implementations 100 // views::ButtonListener implementations
97 void PersonalDataManager::OnAutoFillDialogApply( 101 void PersonalDataManager::OnAutoFillDialogApply(
98 std::vector<AutoFillProfile>* profiles, 102 std::vector<AutoFillProfile>* profiles,
99 std::vector<CreditCard>* credit_cards) { 103 std::vector<CreditCard>* credit_cards) {
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 } 811 }
808 812
809 creditcards.push_back(**iter); 813 creditcards.push_back(**iter);
810 } 814 }
811 815
812 if (!merged) 816 if (!merged)
813 creditcards.push_back(*imported_credit_card_); 817 creditcards.push_back(*imported_credit_card_);
814 818
815 SetCreditCards(&creditcards); 819 SetCreditCards(&creditcards);
816 } 820 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_profile_unittest.cc ('k') | chrome/browser/autofill/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698