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