Commit 5724a4fc authored by Vadym Doroshenko's avatar Vadym Doroshenko Committed by Commit Bot

Removed unused methods in AutofillAgent and PasswordAutofillAgent.

1.autofill::AutofillAgent::SendFormEvents (only header).
2.FindFormAndFieldForNode (only header)
3.IsUserGesture
4.PasswordManager::ShowNotSecureWarning

Bug: 785524, 1007974
Change-Id: I9fdefa2f3023eea0ea2202793d3f6ab6315dbe9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823871
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699804}
parent 5b4311c4
......@@ -389,16 +389,12 @@ TEST_F(AutofillRendererTest, IgnoreNonUserGestureTextFieldChanges) {
while (!full_name.Focused())
GetMainFrame()->View()->AdvanceFocus(false);
// Not a user gesture, so no IPC message to browser.
DisableUserGestureSimulationForAutofill();
ASSERT_FALSE(fake_driver_.called_field_change());
full_name.SetValue("Alice", true);
GetMainFrame()->AutofillClient()->TextFieldDidChange(full_name);
base::RunLoop().RunUntilIdle();
ASSERT_FALSE(fake_driver_.called_field_change());
// A user gesture will send a message to the browser.
EnableUserGestureSimulationForAutofill();
SimulateUserInputChangeForElement(&full_name, "Alice");
ASSERT_TRUE(fake_driver_.called_field_change());
}
......
......@@ -65,7 +65,6 @@ class MockAutofillAgent : public AutofillAgent {
password_autofill_agent,
password_generation_agent,
registry) {
ON_CALL(*this, IsUserGesture()).WillByDefault(Return(true));
}
~MockAutofillAgent() override {}
......@@ -77,8 +76,6 @@ class MockAutofillAgent : public AutofillAgent {
run_loop_.reset();
}
MOCK_CONST_METHOD0(IsUserGesture, bool());
private:
void DidAssociateFormControlsDynamically() override {
AutofillAgent::DidAssociateFormControlsDynamically();
......@@ -100,8 +97,7 @@ ChromeRenderViewTest::ChromeRenderViewTest()
chrome_render_thread_(NULL) {
}
ChromeRenderViewTest::~ChromeRenderViewTest() {
}
ChromeRenderViewTest::~ChromeRenderViewTest() = default;
void ChromeRenderViewTest::SetUp() {
ChromeUnitTestSuite::InitializeProviders();
......@@ -177,16 +173,6 @@ void ChromeRenderViewTest::InitChromeContentRendererClient(
#endif
}
void ChromeRenderViewTest::EnableUserGestureSimulationForAutofill() {
EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
IsUserGesture()).WillRepeatedly(Return(true));
}
void ChromeRenderViewTest::DisableUserGestureSimulationForAutofill() {
EXPECT_CALL(*(static_cast<MockAutofillAgent*>(autofill_agent_)),
IsUserGesture()).WillRepeatedly(Return(false));
}
void ChromeRenderViewTest::WaitForAutofillDidAssociateFormControl() {
static_cast<MockAutofillAgent*>(autofill_agent_)
->WaitForAutofillDidAssociateFormControl();
......
......@@ -41,8 +41,6 @@ class ChromeRenderViewTest : public content::RenderViewTest {
// Use when overriding CreateContentRendererClient.
void InitChromeContentRendererClient(ChromeContentRendererClient* client);
void EnableUserGestureSimulationForAutofill();
void DisableUserGestureSimulationForAutofill();
void WaitForAutofillDidAssociateFormControl();
autofill::TestPasswordAutofillAgent* password_autofill_agent_;
......
......@@ -820,11 +820,6 @@ void AutofillAgent::HidePopup() {
GetAutofillDriver()->HidePopup();
}
bool AutofillAgent::IsUserGesture() const {
return WebUserGestureIndicator::IsProcessingUserGesture(
render_frame()->GetWebFrame());
}
void AutofillAgent::DidAssociateFormControlsDynamically() {
// If the control flow is here than the document was at least loaded. The
// whole page doesn't have to be loaded.
......
......@@ -40,7 +40,6 @@ class WebVector;
namespace autofill {
struct FormData;
struct FormFieldData;
class PasswordAutofillAgent;
class PasswordGenerationAgent;
......@@ -229,12 +228,6 @@ class AutofillAgent : public content::RenderFrameObserver,
// Sets the element value to reflect the selected |suggested_value|.
void DoAcceptDataListSuggestion(const base::string16& suggested_value);
// Fills |form| and |field| with the FormData and FormField corresponding to
// |node|. Returns true if the data was found; and false otherwise.
bool FindFormAndFieldForNode(const blink::WebNode& node,
FormData* form,
FormFieldData* field) WARN_UNUSED_RESULT;
// Set |node| to display the given |value|.
void DoFillFieldWithValue(const base::string16& value,
blink::WebInputElement* node);
......@@ -248,24 +241,9 @@ class AutofillAgent : public content::RenderFrameObserver,
// Notifies browser of new fillable forms in |render_frame|.
void ProcessForms();
// Sends a message to the browser that the form is about to be submitted,
// only if the particular message has not been previously submitted for the
// form in the current frame.
// Additionally, depending on |send_submitted_event| a message is sent to the
// browser that the form was submitted.
void SendFormEvents(const blink::WebFormElement& form,
bool send_submitted_event);
// Hides any currently showing Autofill popup.
void HidePopup();
// TODO(crbug.com/785524): Investigate why this method need to be mocked in
// chrome_render_view_test.cc, this isn't called now, but this is no test
// failed.
// Returns true if the text field change is due to a user gesture. Can be
// overriden in tests.
virtual bool IsUserGesture() const;
// Attempt to get submitted FormData from last_interacted_form_ or
// provisionally_saved_form_, return true if |form| is set.
bool GetSubmittedForm(FormData* form);
......
......@@ -196,11 +196,6 @@ class PasswordAutofillAgent : public content::RenderFrameObserver,
bool show_all,
bool generation_popup_showing);
// Shows an Autofill-style popup with a warning that the form is not secure.
// This UI is shown when a username or password field is autofilled or edited
// on a non-secure page.
void ShowNotSecureWarning(const blink::WebInputElement& element);
// Called when new form controls are inserted.
void OnDynamicFormsSeen();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment