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

Side by Side Diff: chrome/browser/ui/webui/options/autofill_options_handler.cc

Issue 14564003: Make PersonalDataManager use GetCreditCards() (rather than using credit_cards_ directly) so Autofill (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 months 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) 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/ui/webui/options/autofill_options_handler.h" 5 #include "chrome/browser/ui/webui/options/autofill_options_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 i != personal_data_->web_profiles().end(); ++i) { 384 i != personal_data_->web_profiles().end(); ++i) {
385 ListValue* entry = new ListValue(); 385 ListValue* entry = new ListValue();
386 entry->Append(new StringValue((*i)->guid())); 386 entry->Append(new StringValue((*i)->guid()));
387 entry->Append(new StringValue((*i)->Label())); 387 entry->Append(new StringValue((*i)->Label()));
388 addresses.Append(entry); 388 addresses.Append(entry);
389 } 389 }
390 390
391 web_ui()->CallJavascriptFunction("AutofillOptions.setAddressList", addresses); 391 web_ui()->CallJavascriptFunction("AutofillOptions.setAddressList", addresses);
392 392
393 ListValue credit_cards; 393 ListValue credit_cards;
394 for (std::vector<CreditCard*>::const_iterator i = 394 const std::vector<CreditCard*>& cards = personal_data_->GetCreditCards();
395 personal_data_->credit_cards().begin(); 395 for (std::vector<CreditCard*>::const_iterator iter = cards.begin();
396 i != personal_data_->credit_cards().end(); ++i) { 396 iter != cards.end(); ++iter) {
397 const CreditCard* card = *i; 397 const CreditCard* card = *iter;
398 // TODO(estade): this should be a dictionary. 398 // TODO(estade): this should be a dictionary.
399 ListValue* entry = new ListValue(); 399 ListValue* entry = new ListValue();
400 entry->Append(new StringValue(card->guid())); 400 entry->Append(new StringValue(card->guid()));
401 entry->Append(new StringValue(card->Label())); 401 entry->Append(new StringValue(card->Label()));
402 entry->Append(new StringValue( 402 entry->Append(new StringValue(
403 webui::GetBitmapDataUrlFromResource(card->IconResourceId()))); 403 webui::GetBitmapDataUrlFromResource(card->IconResourceId())));
404 entry->Append(new StringValue(card->TypeForDisplay())); 404 entry->Append(new StringValue(card->TypeForDisplay()));
405 credit_cards.Append(entry); 405 credit_cards.Append(entry);
406 } 406 }
407 407
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 597
598 web_ui()->CallJavascriptFunction( 598 web_ui()->CallJavascriptFunction(
599 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value); 599 "AutofillEditAddressOverlay.setValidatedPhoneNumbers", *list_value);
600 } 600 }
601 601
602 bool AutofillOptionsHandler::IsPersonalDataLoaded() const { 602 bool AutofillOptionsHandler::IsPersonalDataLoaded() const {
603 return personal_data_ && personal_data_->IsDataLoaded(); 603 return personal_data_ && personal_data_->IsDataLoaded();
604 } 604 }
605 605
606 } // namespace options 606 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc ('k') | components/autofill/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698