| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "base/tuple.h" | 14 #include "base/tuple.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/autocomplete_history_manager.h" | 16 #include "chrome/browser/autocomplete_history_manager.h" |
| 17 #include "chrome/browser/autofill/autofill_common_test.h" | 17 #include "chrome/browser/autofill/autofill_common_test.h" |
| 18 #include "chrome/browser/autofill/autofill_external_delegate.h" | 18 #include "chrome/browser/autofill/autofill_external_delegate_test.h" |
| 19 #include "chrome/browser/autofill/autofill_manager.h" | 19 #include "chrome/browser/autofill/autofill_manager.h" |
| 20 #include "chrome/browser/autofill/autofill_profile.h" | 20 #include "chrome/browser/autofill/autofill_profile.h" |
| 21 #include "chrome/browser/autofill/credit_card.h" | 21 #include "chrome/browser/autofill/credit_card.h" |
| 22 #include "chrome/browser/autofill/personal_data_manager.h" | 22 #include "chrome/browser/autofill/personal_data_manager.h" |
| 23 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 23 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 24 #include "chrome/browser/prefs/pref_service.h" | 24 #include "chrome/browser/prefs/pref_service.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 27 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 27 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 28 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 28 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
| (...skipping 2826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2855 types.insert(UNKNOWN_TYPE); | 2855 types.insert(UNKNOWN_TYPE); |
| 2856 form.fields.push_back(field); | 2856 form.fields.push_back(field); |
| 2857 expected_types.push_back(types); | 2857 expected_types.push_back(types); |
| 2858 | 2858 |
| 2859 autofill_manager_->set_expected_submitted_field_types(expected_types); | 2859 autofill_manager_->set_expected_submitted_field_types(expected_types); |
| 2860 FormSubmitted(form); | 2860 FormSubmitted(form); |
| 2861 } | 2861 } |
| 2862 | 2862 |
| 2863 namespace { | 2863 namespace { |
| 2864 | 2864 |
| 2865 class MockAutofillExternalDelegate : public AutofillExternalDelegate { | 2865 class MockAutofillExternalDelegate : public AutofillExternalDelegateTest { |
| 2866 public: | 2866 public: |
| 2867 explicit MockAutofillExternalDelegate(TabContentsWrapper* wrapper, | 2867 explicit MockAutofillExternalDelegate(TabContentsWrapper* wrapper, |
| 2868 AutofillManager* autofill_manager) | 2868 AutofillManager* autofill_manager) |
| 2869 : AutofillExternalDelegate(wrapper, autofill_manager) {} | 2869 : AutofillExternalDelegateTest(wrapper, autofill_manager) {} |
| 2870 virtual ~MockAutofillExternalDelegate() {} | 2870 virtual ~MockAutofillExternalDelegate() {} |
| 2871 | 2871 |
| 2872 MOCK_METHOD5(OnQuery, void(int query_id, | 2872 MOCK_METHOD5(OnQuery, void(int query_id, |
| 2873 const webkit::forms::FormData& form, | 2873 const webkit::forms::FormData& form, |
| 2874 const webkit::forms::FormField& field, | 2874 const webkit::forms::FormField& field, |
| 2875 const gfx::Rect& bounds, | 2875 const gfx::Rect& bounds, |
| 2876 bool display_warning)); | 2876 bool display_warning)); |
| 2877 | 2877 |
| 2878 virtual void HideAutofillPopup() OVERRIDE {} | |
| 2879 | |
| 2880 virtual void ApplyAutofillSuggestions( | |
| 2881 const std::vector<string16>& autofill_values, | |
| 2882 const std::vector<string16>& autofill_labels, | |
| 2883 const std::vector<string16>& autofill_icons, | |
| 2884 const std::vector<int>& autofill_unique_ids, | |
| 2885 int separator_index) OVERRIDE {} | |
| 2886 | |
| 2887 virtual void OnQueryPlatformSpecific(int query_id, | 2878 virtual void OnQueryPlatformSpecific(int query_id, |
| 2888 const webkit::forms::FormData& form, | 2879 const webkit::forms::FormData& form, |
| 2889 const webkit::forms::FormField& field, | 2880 const webkit::forms::FormField& field, |
| 2890 const gfx::Rect& bounds) OVERRIDE {} | 2881 const gfx::Rect& bounds) OVERRIDE {} |
| 2891 | 2882 |
| 2892 private: | 2883 private: |
| 2893 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); | 2884 DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); |
| 2894 }; | 2885 }; |
| 2895 | 2886 |
| 2896 } // namespace | 2887 } // namespace |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2929 | 2920 |
| 2930 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); | 2921 AutofillManager* autofill_manager = contents_wrapper()->autofill_manager(); |
| 2931 EXPECT_TRUE(autofill_manager->external_delegate()); | 2922 EXPECT_TRUE(autofill_manager->external_delegate()); |
| 2932 | 2923 |
| 2933 AutocompleteHistoryManager* autocomplete_history_manager = | 2924 AutocompleteHistoryManager* autocomplete_history_manager = |
| 2934 contents_wrapper()->autocomplete_history_manager(); | 2925 contents_wrapper()->autocomplete_history_manager(); |
| 2935 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); | 2926 EXPECT_TRUE(autocomplete_history_manager->external_delegate()); |
| 2936 } | 2927 } |
| 2937 | 2928 |
| 2938 #endif // OS_ANDROID | 2929 #endif // OS_ANDROID |
| OLD | NEW |