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

Side by Side Diff: chrome/browser/ui/autofill/data_model_wrapper.cc

Issue 21947003: [Autofill] Move FieldTypeGroup out of the AutofillType class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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/autofill/data_model_wrapper.h" 5 #include "chrome/browser/ui/autofill/data_model_wrapper.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" 10 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 : full_wallet_(full_wallet) { 221 : full_wallet_(full_wallet) {
222 DCHECK(full_wallet_); 222 DCHECK(full_wallet_);
223 } 223 }
224 224
225 FullWalletBillingWrapper::~FullWalletBillingWrapper() {} 225 FullWalletBillingWrapper::~FullWalletBillingWrapper() {}
226 226
227 string16 FullWalletBillingWrapper::GetInfo(AutofillFieldType type) const { 227 string16 FullWalletBillingWrapper::GetInfo(AutofillFieldType type) const {
228 if (type == CREDIT_CARD_EXP_MONTH) 228 if (type == CREDIT_CARD_EXP_MONTH)
229 return MonthComboboxModel::FormatMonth(full_wallet_->expiration_month()); 229 return MonthComboboxModel::FormatMonth(full_wallet_->expiration_month());
230 230
231 if (AutofillType(type).group() == AutofillType::CREDIT_CARD) 231 if (AutofillType(type).group() == CREDIT_CARD)
232 return full_wallet_->GetInfo(type); 232 return full_wallet_->GetInfo(type);
233 233
234 return full_wallet_->billing_address()->GetInfo( 234 return full_wallet_->billing_address()->GetInfo(
235 type, g_browser_process->GetApplicationLocale()); 235 type, g_browser_process->GetApplicationLocale());
236 } 236 }
237 237
238 string16 FullWalletBillingWrapper::GetDisplayText() { 238 string16 FullWalletBillingWrapper::GetDisplayText() {
239 // TODO(dbeam): handle other required actions? http://crbug.com/163508 239 // TODO(dbeam): handle other required actions? http://crbug.com/163508
240 if (full_wallet_->HasRequiredAction(wallet::UPDATE_EXPIRATION_DATE)) 240 if (full_wallet_->HasRequiredAction(wallet::UPDATE_EXPIRATION_DATE))
241 return string16(); 241 return string16();
(...skipping 24 matching lines...) Expand all
266 base::string16 DetailOutputWrapper::GetInfo(AutofillFieldType type) const { 266 base::string16 DetailOutputWrapper::GetInfo(AutofillFieldType type) const {
267 for (DetailOutputMap::const_iterator it = outputs_.begin(); 267 for (DetailOutputMap::const_iterator it = outputs_.begin();
268 it != outputs_.end(); ++it) { 268 it != outputs_.end(); ++it) {
269 if (type == it->first->type) 269 if (type == it->first->type)
270 return it->second; 270 return it->second;
271 } 271 }
272 return base::string16(); 272 return base::string16();
273 } 273 }
274 274
275 } // namespace autofill 275 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698