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 "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_split.h" | 8 #include "base/string_split.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 if (popup_controller_) { | 393 if (popup_controller_) { |
394 popup_controller_->Hide(); | 394 popup_controller_->Hide(); |
395 ControllerDestroyed(); | 395 ControllerDestroyed(); |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 void AutofillDialogController::SelectAutofillSuggestion(int unique_id) { | 399 void AutofillDialogController::SelectAutofillSuggestion(int unique_id) { |
400 // TODO(estade): implement. | 400 // TODO(estade): implement. |
401 } | 401 } |
402 | 402 |
403 bool AutofillDialogController::DidAcceptAutofillSuggestion( | 403 void AutofillDialogController::DidAcceptAutofillSuggestion( |
404 const string16& value, | 404 const string16& value, |
405 int unique_id, | 405 int unique_id) { |
406 unsigned index) { | |
407 const PersonalDataManager::GUIDPair& pair = popup_guids_[unique_id]; | 406 const PersonalDataManager::GUIDPair& pair = popup_guids_[unique_id]; |
408 // TODO(estade): need to use the variant, |pair.second|. | 407 // TODO(estade): need to use the variant, |pair.second|. |
409 AutofillProfile* profile = GetManager()->GetProfileByGUID(pair.first); | 408 AutofillProfile* profile = GetManager()->GetProfileByGUID(pair.first); |
410 // TODO(estade): we shouldn't let this happen. | 409 // TODO(estade): we shouldn't let this happen. |
411 if (!profile) | 410 if (!profile) |
412 return false; | 411 return; |
413 | 412 |
414 // TODO(estade): implement for all sections. | 413 // TODO(estade): implement for all sections. |
415 FillInputFromFormGroup(profile, &requested_billing_fields_); | 414 FillInputFromFormGroup(profile, &requested_billing_fields_); |
416 view_->UpdateSection(SECTION_BILLING); | 415 view_->UpdateSection(SECTION_BILLING); |
417 | 416 |
418 // TODO(estade): not sure why it's necessary to do this explicitly. | 417 // TODO(estade): not sure why it's necessary to do this explicitly. |
419 popup_controller_->Hide(); | 418 popup_controller_->Hide(); |
420 ControllerDestroyed(); | 419 ControllerDestroyed(); |
421 return true; | |
422 } | 420 } |
423 | 421 |
424 void AutofillDialogController::RemoveAutocompleteEntry(const string16& value) { | 422 void AutofillDialogController::RemoveAutocompleteEntry(const string16& value) { |
425 // TODO(estade): implement. | 423 // TODO(estade): implement. |
426 } | 424 } |
427 | 425 |
428 void AutofillDialogController::RemoveAutofillProfileOrCreditCard( | 426 void AutofillDialogController::RemoveAutofillProfileOrCreditCard( |
429 int unique_id) { | 427 int unique_id) { |
430 // TODO(estade): implement. | 428 // TODO(estade): implement. |
431 } | 429 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 546 |
549 NOTREACHED(); | 547 NOTREACHED(); |
550 return NULL; | 548 return NULL; |
551 } | 549 } |
552 | 550 |
553 PersonalDataManager* AutofillDialogController::GetManager() { | 551 PersonalDataManager* AutofillDialogController::GetManager() { |
554 return PersonalDataManagerFactory::GetForProfile(profile_); | 552 return PersonalDataManagerFactory::GetForProfile(profile_); |
555 } | 553 } |
556 | 554 |
557 } // namespace autofill | 555 } // namespace autofill |
OLD | NEW |