Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Unified Diff: components/autofill/core/browser/test_autofill_client.h

Issue 2672623005: Record Autofill form events specially for nonsecure pages (Closed)
Patch Set: fix test added in rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/test_autofill_client.h
diff --git a/components/autofill/core/browser/test_autofill_client.h b/components/autofill/core/browser/test_autofill_client.h
index 95311d7b48b402d9abe17a931c488adc248178e7..72cdd8c3f5757accc172498b2d6de0e88059b979 100644
--- a/components/autofill/core/browser/test_autofill_client.h
+++ b/components/autofill/core/browser/test_autofill_client.h
@@ -67,7 +67,10 @@ class TestAutofillClient : public AutofillClient {
void DidFillOrPreviewField(const base::string16& autofilled_value,
const base::string16& profile_full_name) override;
void OnFirstUserGestureObserved() override;
- bool IsContextSecure(const GURL& form_origin) override;
+ // By default, TestAutofillClient will report that the context is
+ // secure. This can be adjusted by calling set_form_origin() with an
+ // http:// URL.
+ bool IsContextSecure() override;
bool ShouldShowSigninPromo() override;
void StartSigninFlow() override;
void ShowHttpNotSecureExplanation() override;
@@ -80,12 +83,15 @@ class TestAutofillClient : public AutofillClient {
return rappor_service_.get();
}
+ void set_form_origin(const GURL& url) { form_origin_ = url; }
+
private:
// NULL by default.
std::unique_ptr<PrefService> prefs_;
std::unique_ptr<FakeOAuth2TokenService> token_service_;
std::unique_ptr<FakeIdentityProvider> identity_provider_;
std::unique_ptr<rappor::TestRapporServiceImpl> rappor_service_;
+ GURL form_origin_;
DISALLOW_COPY_AND_ASSIGN(TestAutofillClient);
};

Powered by Google App Engine
This is Rietveld 408576698