| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 #include "grit/webkit_resources.h" | 80 #include "grit/webkit_resources.h" |
| 81 #include "net/cert/cert_status_flags.h" | 81 #include "net/cert/cert_status_flags.h" |
| 82 #include "ui/base/base_window.h" | 82 #include "ui/base/base_window.h" |
| 83 #include "ui/base/l10n/l10n_util.h" | 83 #include "ui/base/l10n/l10n_util.h" |
| 84 #include "ui/base/models/combobox_model.h" | 84 #include "ui/base/models/combobox_model.h" |
| 85 #include "ui/base/resource/resource_bundle.h" | 85 #include "ui/base/resource/resource_bundle.h" |
| 86 #include "ui/events/event.h" | 86 #include "ui/events/event.h" |
| 87 #include "ui/gfx/canvas.h" | 87 #include "ui/gfx/canvas.h" |
| 88 #include "ui/gfx/image/image_skia_operations.h" | 88 #include "ui/gfx/image/image_skia_operations.h" |
| 89 #include "ui/gfx/skia_util.h" | 89 #include "ui/gfx/skia_util.h" |
| 90 #include "ui/native_theme/native_theme.h" |
| 90 | 91 |
| 91 namespace autofill { | 92 namespace autofill { |
| 92 | 93 |
| 93 namespace { | 94 namespace { |
| 94 | 95 |
| 95 const char kAddNewItemKey[] = "add-new-item"; | 96 const char kAddNewItemKey[] = "add-new-item"; |
| 96 const char kManageItemsKey[] = "manage-items"; | 97 const char kManageItemsKey[] = "manage-items"; |
| 97 const char kSameAsBillingKey[] = "same-as-billing"; | 98 const char kSameAsBillingKey[] = "same-as-billing"; |
| 98 | 99 |
| 99 // URLs for Wallet error messages. | 100 // URLs for Wallet error messages. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 if (submit_button_delay_timer_.IsRunning()) | 766 if (submit_button_delay_timer_.IsRunning()) |
| 766 return false; | 767 return false; |
| 767 | 768 |
| 768 return true; | 769 return true; |
| 769 } | 770 } |
| 770 | 771 |
| 771 DCHECK_EQ(ui::DIALOG_BUTTON_CANCEL, button); | 772 DCHECK_EQ(ui::DIALOG_BUTTON_CANCEL, button); |
| 772 return !is_submitting_ || IsSubmitPausedOn(wallet::VERIFY_CVV); | 773 return !is_submitting_ || IsSubmitPausedOn(wallet::VERIFY_CVV); |
| 773 } | 774 } |
| 774 | 775 |
| 775 DialogOverlayState AutofillDialogControllerImpl::GetDialogOverlay() { | 776 DialogOverlayState AutofillDialogControllerImpl::GetDialogOverlay( |
| 777 const ui::NativeTheme* theme) { |
| 776 bool show_wallet_interstitial = IsPayingWithWallet() && is_submitting_ && | 778 bool show_wallet_interstitial = IsPayingWithWallet() && is_submitting_ && |
| 777 !(full_wallet_ && !full_wallet_->required_actions().empty()); | 779 !(full_wallet_ && !full_wallet_->required_actions().empty()); |
| 778 if (!show_wallet_interstitial) { | 780 if (!show_wallet_interstitial) { |
| 779 card_scrambling_delay_.Stop(); | 781 card_scrambling_delay_.Stop(); |
| 780 card_scrambling_refresher_.Stop(); | 782 card_scrambling_refresher_.Stop(); |
| 781 return DialogOverlayState(); | 783 return DialogOverlayState(); |
| 782 } | 784 } |
| 783 | 785 |
| 784 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 786 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 785 DialogOverlayState state; | 787 DialogOverlayState state; |
| 786 state.string.font = rb.GetFont(ui::ResourceBundle::BaseFont).DeriveFont(3); | 788 state.string.font = rb.GetFont(ui::ResourceBundle::BaseFont).DeriveFont(3); |
| 787 state.string.text_color = SK_ColorDKGRAY; | 789 state.string.text_color = theme->GetSystemColor( |
| 790 ui::NativeTheme::kColorId_TextfieldReadOnlyColor); |
| 788 | 791 |
| 789 const SkColor start_top_color = SkColorSetRGB(0xD6, 0xD6, 0xD6); | 792 const SkColor start_top_color = SkColorSetRGB(0xD6, 0xD6, 0xD6); |
| 790 const SkColor start_bottom_color = SkColorSetRGB(0x98, 0x98, 0x98); | 793 const SkColor start_bottom_color = SkColorSetRGB(0x98, 0x98, 0x98); |
| 791 const SkColor final_top_color = SkColorSetRGB(0x52, 0x9F, 0xF8); | 794 const SkColor final_top_color = SkColorSetRGB(0x52, 0x9F, 0xF8); |
| 792 const SkColor final_bottom_color = SkColorSetRGB(0x22, 0x75, 0xE5); | 795 const SkColor final_bottom_color = SkColorSetRGB(0x22, 0x75, 0xE5); |
| 793 | 796 |
| 794 if (full_wallet_ && full_wallet_->required_actions().empty()) { | 797 if (full_wallet_ && full_wallet_->required_actions().empty()) { |
| 795 card_scrambling_delay_.Stop(); | 798 card_scrambling_delay_.Stop(); |
| 796 card_scrambling_refresher_.Stop(); | 799 card_scrambling_refresher_.Stop(); |
| 797 | 800 |
| (...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3541 view_->UpdateButtonStrip(); | 3544 view_->UpdateButtonStrip(); |
| 3542 } | 3545 } |
| 3543 | 3546 |
| 3544 void AutofillDialogControllerImpl::FetchWalletCookie() { | 3547 void AutofillDialogControllerImpl::FetchWalletCookie() { |
| 3545 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3548 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
| 3546 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3549 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
| 3547 signin_helper_->StartWalletCookieValueFetch(); | 3550 signin_helper_->StartWalletCookieValueFetch(); |
| 3548 } | 3551 } |
| 3549 | 3552 |
| 3550 } // namespace autofill | 3553 } // namespace autofill |
| OLD | NEW |