| 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_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 return label; | 383 return label; |
| 384 } | 384 } |
| 385 | 385 |
| 386 gfx::Image AutofillDialogControllerImpl::SuggestionIconForSection( | 386 gfx::Image AutofillDialogControllerImpl::SuggestionIconForSection( |
| 387 DialogSection section) { | 387 DialogSection section) { |
| 388 if (section != SECTION_CC) | 388 if (section != SECTION_CC) |
| 389 return gfx::Image(); | 389 return gfx::Image(); |
| 390 | 390 |
| 391 std::string item_key = | 391 std::string item_key = |
| 392 suggested_cc_.GetItemKeyAt(suggested_cc_.checked_item()); | 392 suggested_cc_.GetItemKeyAt(suggested_cc_.checked_item()); |
| 393 if (item_key.empty()) |
| 394 return gfx::Image(); |
| 393 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 395 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 394 CreditCard* card = GetManager()->GetCreditCardByGUID(item_key); | 396 CreditCard* card = GetManager()->GetCreditCardByGUID(item_key); |
| 395 return rb.GetImageNamed(card->IconResourceId()); | 397 return rb.GetImageNamed(card->IconResourceId()); |
| 396 } | 398 } |
| 397 | 399 |
| 398 void AutofillDialogControllerImpl::EditClickedForSection( | 400 void AutofillDialogControllerImpl::EditClickedForSection( |
| 399 DialogSection section) { | 401 DialogSection section) { |
| 400 SuggestionsMenuModel* model = SuggestionsMenuModelForSection(section); | 402 SuggestionsMenuModel* model = SuggestionsMenuModelForSection(section); |
| 401 DetailInputs* inputs = MutableRequestedFieldsForSection(section); | 403 DetailInputs* inputs = MutableRequestedFieldsForSection(section); |
| 402 | 404 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 DialogSection section) { | 952 DialogSection section) { |
| 951 return const_cast<DetailInputs*>(&RequestedFieldsForSection(section)); | 953 return const_cast<DetailInputs*>(&RequestedFieldsForSection(section)); |
| 952 } | 954 } |
| 953 | 955 |
| 954 void AutofillDialogControllerImpl::HidePopup() { | 956 void AutofillDialogControllerImpl::HidePopup() { |
| 955 if (popup_controller_) | 957 if (popup_controller_) |
| 956 popup_controller_->Hide(); | 958 popup_controller_->Hide(); |
| 957 } | 959 } |
| 958 | 960 |
| 959 } // namespace autofill | 961 } // namespace autofill |
| OLD | NEW |