| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 popup_ids); | 389 popup_ids); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void AutofillDialogController::FocusMoved() { | 392 void AutofillDialogController::FocusMoved() { |
| 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::DidSelectSuggestion(int identifier) { |
| 400 // TODO(estade): implement. | 400 // TODO(estade): implement. |
| 401 } | 401 } |
| 402 | 402 |
| 403 bool AutofillDialogController::DidAcceptAutofillSuggestion( | 403 void AutofillDialogController::DidAcceptSuggestion(const string16& value, |
| 404 const string16& value, | 404 int identifier) { |
| 405 int unique_id, | 405 const PersonalDataManager::GUIDPair& pair = popup_guids_[identifier]; |
| 406 unsigned index) { | |
| 407 const PersonalDataManager::GUIDPair& pair = popup_guids_[unique_id]; | |
| 408 // TODO(estade): need to use the variant, |pair.second|. | 406 // TODO(estade): need to use the variant, |pair.second|. |
| 409 AutofillProfile* profile = GetManager()->GetProfileByGUID(pair.first); | 407 AutofillProfile* profile = GetManager()->GetProfileByGUID(pair.first); |
| 410 // TODO(estade): we shouldn't let this happen. | 408 // TODO(estade): we shouldn't let this happen. |
| 411 if (!profile) | 409 if (!profile) |
| 412 return false; | 410 return; |
| 413 | 411 |
| 414 // TODO(estade): implement for all sections. | 412 // TODO(estade): implement for all sections. |
| 415 FillInputFromFormGroup(profile, &requested_billing_fields_); | 413 FillInputFromFormGroup(profile, &requested_billing_fields_); |
| 416 view_->UpdateSection(SECTION_BILLING); | 414 view_->UpdateSection(SECTION_BILLING); |
| 417 | 415 |
| 418 // TODO(estade): not sure why it's necessary to do this explicitly. | 416 // TODO(estade): not sure why it's necessary to do this explicitly. |
| 419 popup_controller_->Hide(); | 417 popup_controller_->Hide(); |
| 420 ControllerDestroyed(); | 418 ControllerDestroyed(); |
| 421 return true; | |
| 422 } | 419 } |
| 423 | 420 |
| 424 void AutofillDialogController::RemoveAutocompleteEntry(const string16& value) { | 421 void AutofillDialogController::RemoveSuggestion(const string16& value, |
| 422 int identifier) { |
| 425 // TODO(estade): implement. | 423 // TODO(estade): implement. |
| 426 } | 424 } |
| 427 | 425 |
| 428 void AutofillDialogController::RemoveAutofillProfileOrCreditCard( | |
| 429 int unique_id) { | |
| 430 // TODO(estade): implement. | |
| 431 } | |
| 432 | |
| 433 void AutofillDialogController::ClearPreviewedForm() { | 426 void AutofillDialogController::ClearPreviewedForm() { |
| 434 // TODO(estade): implement. | 427 // TODO(estade): implement. |
| 435 } | 428 } |
| 436 | 429 |
| 437 void AutofillDialogController::ControllerDestroyed() { | 430 void AutofillDialogController::ControllerDestroyed() { |
| 438 popup_controller_ = NULL; | 431 popup_controller_ = NULL; |
| 439 } | 432 } |
| 440 | 433 |
| 441 void AutofillDialogController::GenerateComboboxModels() { | 434 void AutofillDialogController::GenerateComboboxModels() { |
| 442 PersonalDataManager* manager = GetManager(); | 435 PersonalDataManager* manager = GetManager(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 541 |
| 549 NOTREACHED(); | 542 NOTREACHED(); |
| 550 return NULL; | 543 return NULL; |
| 551 } | 544 } |
| 552 | 545 |
| 553 PersonalDataManager* AutofillDialogController::GetManager() { | 546 PersonalDataManager* AutofillDialogController::GetManager() { |
| 554 return PersonalDataManagerFactory::GetForProfile(profile_); | 547 return PersonalDataManagerFactory::GetForProfile(profile_); |
| 555 } | 548 } |
| 556 | 549 |
| 557 } // namespace autofill | 550 } // namespace autofill |
| OLD | NEW |