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 #include <utility> |
10 | 11 |
11 #include "base/bind.h" | 12 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
13 #include "base/i18n/case_conversion.h" | 14 #include "base/i18n/case_conversion.h" |
14 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
15 #include "base/location.h" | 16 #include "base/location.h" |
16 #include "base/logging.h" | 17 #include "base/logging.h" |
17 #include "base/macros.h" | 18 #include "base/macros.h" |
18 #include "base/prefs/pref_registry_simple.h" | 19 #include "base/prefs/pref_registry_simple.h" |
19 #include "base/prefs/pref_service.h" | 20 #include "base/prefs/pref_service.h" |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 const content::NativeWebKeyboardEvent& event) { | 1424 const content::NativeWebKeyboardEvent& event) { |
1424 if (popup_controller_.get()) | 1425 if (popup_controller_.get()) |
1425 return popup_controller_->HandleKeyPressEvent(event); | 1426 return popup_controller_->HandleKeyPressEvent(event); |
1426 | 1427 |
1427 return false; | 1428 return false; |
1428 } | 1429 } |
1429 | 1430 |
1430 void AutofillDialogControllerImpl::ShowNewCreditCardBubble( | 1431 void AutofillDialogControllerImpl::ShowNewCreditCardBubble( |
1431 scoped_ptr<CreditCard> new_card, | 1432 scoped_ptr<CreditCard> new_card, |
1432 scoped_ptr<AutofillProfile> billing_profile) { | 1433 scoped_ptr<AutofillProfile> billing_profile) { |
1433 NewCreditCardBubbleController::Show(web_contents(), | 1434 NewCreditCardBubbleController::Show(web_contents(), std::move(new_card), |
1434 new_card.Pass(), | 1435 std::move(billing_profile)); |
1435 billing_profile.Pass()); | |
1436 } | 1436 } |
1437 | 1437 |
1438 void AutofillDialogControllerImpl::SubmitButtonDelayBegin() { | 1438 void AutofillDialogControllerImpl::SubmitButtonDelayBegin() { |
1439 submit_button_delay_timer_.Start( | 1439 submit_button_delay_timer_.Start( |
1440 FROM_HERE, | 1440 FROM_HERE, |
1441 base::TimeDelta::FromMilliseconds(kSubmitButtonDelayMs), | 1441 base::TimeDelta::FromMilliseconds(kSubmitButtonDelayMs), |
1442 this, | 1442 this, |
1443 &AutofillDialogControllerImpl::OnSubmitButtonDelayEnd); | 1443 &AutofillDialogControllerImpl::OnSubmitButtonDelayEnd); |
1444 } | 1444 } |
1445 | 1445 |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2296 FillFormGroupFromOutputs(outputs, billing_profile.get()); | 2296 FillFormGroupFromOutputs(outputs, billing_profile.get()); |
2297 billing_profile->set_language_code(billing_address_language_code_); | 2297 billing_profile->set_language_code(billing_address_language_code_); |
2298 } else { | 2298 } else { |
2299 // Just snag the currently suggested profile. | 2299 // Just snag the currently suggested profile. |
2300 std::string item_key = SuggestionsMenuModelForSection(SECTION_BILLING) | 2300 std::string item_key = SuggestionsMenuModelForSection(SECTION_BILLING) |
2301 ->GetItemKeyForCheckedItem(); | 2301 ->GetItemKeyForCheckedItem(); |
2302 AutofillProfile* profile = GetManager()->GetProfileByGUID(item_key); | 2302 AutofillProfile* profile = GetManager()->GetProfileByGUID(item_key); |
2303 billing_profile.reset(new AutofillProfile(*profile)); | 2303 billing_profile.reset(new AutofillProfile(*profile)); |
2304 } | 2304 } |
2305 | 2305 |
2306 ShowNewCreditCardBubble(newly_saved_card_.Pass(), billing_profile.Pass()); | 2306 ShowNewCreditCardBubble(std::move(newly_saved_card_), |
| 2307 std::move(billing_profile)); |
2307 } | 2308 } |
2308 | 2309 |
2309 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { | 2310 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { |
2310 if (!view_) | 2311 if (!view_) |
2311 return; | 2312 return; |
2312 ScopedViewUpdates updates(view_.get()); | 2313 ScopedViewUpdates updates(view_.get()); |
2313 view_->UpdateButtonStrip(); | 2314 view_->UpdateButtonStrip(); |
2314 } | 2315 } |
2315 | 2316 |
2316 } // namespace autofill | 2317 } // namespace autofill |
OLD | NEW |