| 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 "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 | 1352 |
| 1353 gfx::Image AutofillDialogControllerImpl::ButtonStripImage() const { | 1353 gfx::Image AutofillDialogControllerImpl::ButtonStripImage() const { |
| 1354 if (IsPayingWithWallet()) { | 1354 if (IsPayingWithWallet()) { |
| 1355 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 1355 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 1356 IDR_WALLET_LOGO); | 1356 IDR_WALLET_LOGO); |
| 1357 } | 1357 } |
| 1358 | 1358 |
| 1359 return gfx::Image(); | 1359 return gfx::Image(); |
| 1360 } | 1360 } |
| 1361 | 1361 |
| 1362 base::string16 AutofillDialogControllerImpl::LabelForSection( | 1362 SectionLabel AutofillDialogControllerImpl::LabelForSection( |
| 1363 DialogSection section) const { | 1363 DialogSection section) const { |
| 1364 int ids = 0; |
| 1364 switch (section) { | 1365 switch (section) { |
| 1365 case SECTION_CC: | 1366 case SECTION_CC: |
| 1366 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_CC); | 1367 ids = IDS_AUTOFILL_DIALOG_SECTION_CC; |
| 1368 break; |
| 1367 case SECTION_BILLING: | 1369 case SECTION_BILLING: |
| 1368 case SECTION_CC_BILLING: | 1370 case SECTION_CC_BILLING: |
| 1369 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_BILLING); | 1371 ids = IDS_AUTOFILL_DIALOG_SECTION_BILLING; |
| 1372 break; |
| 1370 case SECTION_SHIPPING: | 1373 case SECTION_SHIPPING: |
| 1371 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SECTION_SHIPPING); | 1374 ids = IDS_AUTOFILL_DIALOG_SECTION_SHIPPING; |
| 1375 break; |
| 1372 } | 1376 } |
| 1373 NOTREACHED(); | 1377 |
| 1374 return base::string16(); | 1378 SectionLabel label = { l10n_util::GetStringUTF16(ids), |
| 1379 ui::ResourceBundle::BoldOnlyIfItLooksGood() }; |
| 1380 return label; |
| 1375 } | 1381 } |
| 1376 | 1382 |
| 1377 SuggestionState AutofillDialogControllerImpl::SuggestionStateForSection( | 1383 SuggestionState AutofillDialogControllerImpl::SuggestionStateForSection( |
| 1378 DialogSection section) { | 1384 DialogSection section) { |
| 1379 base::string16 vertically_compact, horizontally_compact; | 1385 base::string16 vertically_compact, horizontally_compact; |
| 1380 bool show_suggestion = SuggestionTextForSection(section, | 1386 bool show_suggestion = SuggestionTextForSection(section, |
| 1381 &vertically_compact, | 1387 &vertically_compact, |
| 1382 &horizontally_compact); | 1388 &horizontally_compact); |
| 1383 return SuggestionState(show_suggestion, | 1389 return SuggestionState(show_suggestion, |
| 1384 vertically_compact, | 1390 vertically_compact, |
| (...skipping 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3648 view_->UpdateButtonStrip(); | 3654 view_->UpdateButtonStrip(); |
| 3649 } | 3655 } |
| 3650 | 3656 |
| 3651 void AutofillDialogControllerImpl::FetchWalletCookie() { | 3657 void AutofillDialogControllerImpl::FetchWalletCookie() { |
| 3652 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3658 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
| 3653 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3659 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
| 3654 signin_helper_->StartWalletCookieValueFetch(); | 3660 signin_helper_->StartWalletCookieValueFetch(); |
| 3655 } | 3661 } |
| 3656 | 3662 |
| 3657 } // namespace autofill | 3663 } // namespace autofill |
| OLD | NEW |