| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const std::vector<base::string16>& values, | 60 const std::vector<base::string16>& values, |
| 61 const std::vector<base::string16>& labels) override; | 61 const std::vector<base::string16>& labels) override; |
| 62 void HideAutofillPopup() override; | 62 void HideAutofillPopup() override; |
| 63 bool IsAutocompleteEnabled() override; | 63 bool IsAutocompleteEnabled() override; |
| 64 void PropagateAutofillPredictions( | 64 void PropagateAutofillPredictions( |
| 65 content::RenderFrameHost* rfh, | 65 content::RenderFrameHost* rfh, |
| 66 const std::vector<autofill::FormStructure*>& forms) override; | 66 const std::vector<autofill::FormStructure*>& forms) override; |
| 67 void DidFillOrPreviewField(const base::string16& autofilled_value, | 67 void DidFillOrPreviewField(const base::string16& autofilled_value, |
| 68 const base::string16& profile_full_name) override; | 68 const base::string16& profile_full_name) override; |
| 69 void OnFirstUserGestureObserved() override; | 69 void OnFirstUserGestureObserved() override; |
| 70 bool IsContextSecure(const GURL& form_origin) override; | 70 // By default, TestAutofillClient will report that the context is |
| 71 // secure. This can be adjusted by calling set_form_origin() with an |
| 72 // http:// URL. |
| 73 bool IsContextSecure() override; |
| 71 bool ShouldShowSigninPromo() override; | 74 bool ShouldShowSigninPromo() override; |
| 72 void StartSigninFlow() override; | 75 void StartSigninFlow() override; |
| 73 void ShowHttpNotSecureExplanation() override; | 76 void ShowHttpNotSecureExplanation() override; |
| 74 | 77 |
| 75 void SetPrefs(std::unique_ptr<PrefService> prefs) { | 78 void SetPrefs(std::unique_ptr<PrefService> prefs) { |
| 76 prefs_ = std::move(prefs); | 79 prefs_ = std::move(prefs); |
| 77 } | 80 } |
| 78 | 81 |
| 79 rappor::TestRapporServiceImpl* test_rappor_service() { | 82 rappor::TestRapporServiceImpl* test_rappor_service() { |
| 80 return rappor_service_.get(); | 83 return rappor_service_.get(); |
| 81 } | 84 } |
| 82 | 85 |
| 86 void set_form_origin(const GURL& url) { form_origin_ = url; } |
| 87 |
| 83 private: | 88 private: |
| 84 // NULL by default. | 89 // NULL by default. |
| 85 std::unique_ptr<PrefService> prefs_; | 90 std::unique_ptr<PrefService> prefs_; |
| 86 std::unique_ptr<FakeOAuth2TokenService> token_service_; | 91 std::unique_ptr<FakeOAuth2TokenService> token_service_; |
| 87 std::unique_ptr<FakeIdentityProvider> identity_provider_; | 92 std::unique_ptr<FakeIdentityProvider> identity_provider_; |
| 88 std::unique_ptr<rappor::TestRapporServiceImpl> rappor_service_; | 93 std::unique_ptr<rappor::TestRapporServiceImpl> rappor_service_; |
| 94 GURL form_origin_; |
| 89 | 95 |
| 90 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); | 96 DISALLOW_COPY_AND_ASSIGN(TestAutofillClient); |
| 91 }; | 97 }; |
| 92 | 98 |
| 93 } // namespace autofill | 99 } // namespace autofill |
| 94 | 100 |
| 95 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ | 101 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLIENT_H_ |
| OLD | NEW |