| 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/mock_autofill_dialog_view_delegate.h" | 5 #include "chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h" |
| 6 #include "content/public/browser/native_web_keyboard_event.h" // For gmock. | 6 #include "content/public/browser/native_web_keyboard_event.h" // For gmock. |
| 7 #include "grit/generated_resources.h" | 7 #include "grit/generated_resources.h" |
| 8 #include "ui/base/l10n/l10n_util.h" |
| 8 #include "ui/gfx/rect.h" // Only needed because gmock needs complete types. | 9 #include "ui/gfx/rect.h" // Only needed because gmock needs complete types. |
| 9 | 10 |
| 10 namespace autofill { | 11 namespace autofill { |
| 11 | 12 |
| 12 MockAutofillDialogViewDelegate::MockAutofillDialogViewDelegate() { | 13 MockAutofillDialogViewDelegate::MockAutofillDialogViewDelegate() { |
| 13 using testing::DefaultValue; | 14 using testing::DefaultValue; |
| 14 using testing::_; | 15 using testing::_; |
| 15 using testing::Return; | 16 using testing::Return; |
| 16 using testing::ReturnRef; | 17 using testing::ReturnRef; |
| 17 | 18 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 string16(), | 30 string16(), |
| 30 gfx::Image(), | 31 gfx::Image(), |
| 31 string16(), | 32 string16(), |
| 32 gfx::Image())); | 33 gfx::Image())); |
| 33 DefaultValue<FieldIconMap>::Set(FieldIconMap()); | 34 DefaultValue<FieldIconMap>::Set(FieldIconMap()); |
| 34 DefaultValue<std::vector<DialogNotification> >::Set( | 35 DefaultValue<std::vector<DialogNotification> >::Set( |
| 35 std::vector<DialogNotification>()); | 36 std::vector<DialogNotification>()); |
| 36 | 37 |
| 37 // SECTION_CC *must* have a CREDIT_CARD_VERIFICATION_CODE field. | 38 // SECTION_CC *must* have a CREDIT_CARD_VERIFICATION_CODE field. |
| 38 const DetailInput kCreditCardInputs[] = { | 39 const DetailInput kCreditCardInputs[] = { |
| 39 { 2, CREDIT_CARD_VERIFICATION_CODE, IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC } | 40 { 2, CREDIT_CARD_VERIFICATION_CODE, |
| 41 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC) } |
| 40 }; | 42 }; |
| 41 cc_default_inputs_.push_back(kCreditCardInputs[0]); | 43 cc_default_inputs_.push_back(kCreditCardInputs[0]); |
| 42 ON_CALL(*this, RequestedFieldsForSection(SECTION_CC)) | 44 ON_CALL(*this, RequestedFieldsForSection(SECTION_CC)) |
| 43 .WillByDefault(ReturnRef(cc_default_inputs_)); | 45 .WillByDefault(ReturnRef(cc_default_inputs_)); |
| 44 ON_CALL(*this, RequestedFieldsForSection(SECTION_CC_BILLING)) | 46 ON_CALL(*this, RequestedFieldsForSection(SECTION_CC_BILLING)) |
| 45 .WillByDefault(ReturnRef(cc_default_inputs_)); | 47 .WillByDefault(ReturnRef(cc_default_inputs_)); |
| 46 | 48 |
| 47 ON_CALL(*this, GetDialogButtons()) | 49 ON_CALL(*this, GetDialogButtons()) |
| 48 .WillByDefault(Return(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL)); | 50 .WillByDefault(Return(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL)); |
| 49 ON_CALL(*this, LegalDocumentLinks()).WillByDefault(ReturnRef(range_)); | 51 ON_CALL(*this, LegalDocumentLinks()).WillByDefault(ReturnRef(range_)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 DefaultValue<string16>::Clear(); | 75 DefaultValue<string16>::Clear(); |
| 74 DefaultValue<GURL>::Clear(); | 76 DefaultValue<GURL>::Clear(); |
| 75 DefaultValue<const DetailInputs&>::Clear(); | 77 DefaultValue<const DetailInputs&>::Clear(); |
| 76 DefaultValue<FieldIconMap>::Clear(); | 78 DefaultValue<FieldIconMap>::Clear(); |
| 77 DefaultValue<std::vector<DialogNotification> >::Clear(); | 79 DefaultValue<std::vector<DialogNotification> >::Clear(); |
| 78 DefaultValue<content::WebContents*>::Clear(); | 80 DefaultValue<content::WebContents*>::Clear(); |
| 79 DefaultValue<Profile*>::Clear(); | 81 DefaultValue<Profile*>::Clear(); |
| 80 } | 82 } |
| 81 | 83 |
| 82 } // namespace autofill | 84 } // namespace autofill |
| OLD | NEW |