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 "components/autofill/browser/wallet/wallet_items.h" | 5 #include "components/autofill/browser/wallet/wallet_items.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "grit/webkit_resources.h" | 10 #include "grit/webkit_resources.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return !(*this == other); | 199 return !(*this == other); |
200 } | 200 } |
201 | 201 |
202 bool WalletItems::HasRequiredAction(RequiredAction action) const { | 202 bool WalletItems::HasRequiredAction(RequiredAction action) const { |
203 DCHECK(ActionAppliesToWalletItems(action)); | 203 DCHECK(ActionAppliesToWalletItems(action)); |
204 return std::find(required_actions_.begin(), | 204 return std::find(required_actions_.begin(), |
205 required_actions_.end(), | 205 required_actions_.end(), |
206 action) != required_actions_.end(); | 206 action) != required_actions_.end(); |
207 } | 207 } |
208 | 208 |
| 209 string16 WalletItems::MaskedInstrument::DisplayName() const { |
| 210 #if defined(OS_ANDROID) |
| 211 // TODO(aruslan): improve this stub implementation. |
| 212 return descriptive_name(); |
| 213 #else |
| 214 return descriptive_name(); |
| 215 #endif |
| 216 } |
| 217 |
| 218 string16 WalletItems::MaskedInstrument::DisplayNameDetail() const { |
| 219 #if defined(OS_ANDROID) |
| 220 // TODO(aruslan): improve this stub implementation. |
| 221 return address().DisplayName(); |
| 222 #else |
| 223 return string16(); |
| 224 #endif |
| 225 } |
| 226 |
209 const gfx::Image& WalletItems::MaskedInstrument::CardIcon() const { | 227 const gfx::Image& WalletItems::MaskedInstrument::CardIcon() const { |
210 int idr = 0; | 228 int idr = 0; |
211 switch (type_) { | 229 switch (type_) { |
212 case AMEX: | 230 case AMEX: |
213 idr = IDR_AUTOFILL_CC_AMEX; | 231 idr = IDR_AUTOFILL_CC_AMEX; |
214 break; | 232 break; |
215 | 233 |
216 case DISCOVER: | 234 case DISCOVER: |
217 idr = IDR_AUTOFILL_CC_DISCOVER; | 235 idr = IDR_AUTOFILL_CC_DISCOVER; |
218 break; | 236 break; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 required_actions_ == other.required_actions_ && | 420 required_actions_ == other.required_actions_ && |
403 obfuscated_gaia_id_ == other.obfuscated_gaia_id_; | 421 obfuscated_gaia_id_ == other.obfuscated_gaia_id_; |
404 } | 422 } |
405 | 423 |
406 bool WalletItems::operator!=(const WalletItems& other) const { | 424 bool WalletItems::operator!=(const WalletItems& other) const { |
407 return !(*this == other); | 425 return !(*this == other); |
408 } | 426 } |
409 | 427 |
410 } // namespace wallet | 428 } // namespace wallet |
411 } // namespace autofill | 429 } // namespace autofill |
OLD | NEW |