Commit bd0e682c authored by Ioana Pandele's avatar Ioana Pandele Committed by Commit Bot

Remove unused parameter in PasswordAccessoryController

The origin passed into
PasswordAccessoryController::RefreshSuggestionsForField is never used.
This CL removes it.

TBR=tmartino@chromium.org
(for trivial mock change)

Bug:none

Change-Id: Ibe6d487143137220bf4692ea3c919a2a39d86e41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632149
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663783}
parent 0ef95c51
...@@ -38,8 +38,7 @@ class MockPasswordAccessoryController : public PasswordAccessoryController { ...@@ -38,8 +38,7 @@ class MockPasswordAccessoryController : public PasswordAccessoryController {
void(const std::map<base::string16, const autofill::PasswordForm*>&, void(const std::map<base::string16, const autofill::PasswordForm*>&,
const url::Origin&)); const url::Origin&));
MOCK_METHOD1(OnFilledIntoFocusedField, void(autofill::FillingStatus)); MOCK_METHOD1(OnFilledIntoFocusedField, void(autofill::FillingStatus));
MOCK_METHOD3(RefreshSuggestionsForField, MOCK_METHOD2(RefreshSuggestionsForField, void(FocusedFieldType, bool));
void(const url::Origin&, FocusedFieldType, bool));
MOCK_METHOD0(DidNavigateMainFrame, void()); MOCK_METHOD0(DidNavigateMainFrame, void());
MOCK_METHOD2(GetFavicon, MOCK_METHOD2(GetFavicon,
void(int, base::OnceCallback<void(const gfx::Image&)>)); void(int, base::OnceCallback<void(const gfx::Image&)>));
......
...@@ -1036,17 +1036,10 @@ void ChromePasswordManagerClient::FocusedInputChanged( ...@@ -1036,17 +1036,10 @@ void ChromePasswordManagerClient::FocusedInputChanged(
autofill::mojom::FocusedFieldType focused_field_type) { autofill::mojom::FocusedFieldType focused_field_type) {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
if (PasswordAccessoryController::AllowedForWebContents(web_contents())) { if (PasswordAccessoryController::AllowedForWebContents(web_contents())) {
bool is_manual_generation_available =
password_manager_util::ManualPasswordGenerationEnabled(driver);
password_manager::ContentPasswordManagerDriver* content_driver =
static_cast<password_manager::ContentPasswordManagerDriver*>(driver);
url::Origin last_committed_origin =
content_driver->render_frame_host()->GetLastCommittedOrigin();
PasswordAccessoryController::GetOrCreate(web_contents()) PasswordAccessoryController::GetOrCreate(web_contents())
->RefreshSuggestionsForField(last_committed_origin, focused_field_type, ->RefreshSuggestionsForField(
is_manual_generation_available); focused_field_type,
password_manager_util::ManualPasswordGenerationEnabled(driver));
} }
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
} }
......
...@@ -73,7 +73,6 @@ class PasswordAccessoryController ...@@ -73,7 +73,6 @@ class PasswordAccessoryController
// Makes sure, that all shown suggestions are appropriate for the currently // Makes sure, that all shown suggestions are appropriate for the currently
// focused field and for fields that lost the focus. // focused field and for fields that lost the focus.
virtual void RefreshSuggestionsForField( virtual void RefreshSuggestionsForField(
const url::Origin& origin,
autofill::mojom::FocusedFieldType focused_field_type, autofill::mojom::FocusedFieldType focused_field_type,
bool is_manual_generation_available) = 0; bool is_manual_generation_available) = 0;
......
...@@ -184,7 +184,6 @@ void PasswordAccessoryControllerImpl::OnOptionSelected( ...@@ -184,7 +184,6 @@ void PasswordAccessoryControllerImpl::OnOptionSelected(
} }
void PasswordAccessoryControllerImpl::RefreshSuggestionsForField( void PasswordAccessoryControllerImpl::RefreshSuggestionsForField(
const url::Origin& origin,
FocusedFieldType focused_field_type, FocusedFieldType focused_field_type,
bool is_manual_generation_available) { bool is_manual_generation_available) {
std::vector<UserInfo> info_to_add; std::vector<UserInfo> info_to_add;
......
...@@ -69,7 +69,6 @@ class PasswordAccessoryControllerImpl ...@@ -69,7 +69,6 @@ class PasswordAccessoryControllerImpl
const url::Origin& origin) override; const url::Origin& origin) override;
void OnFilledIntoFocusedField(autofill::FillingStatus status) override; void OnFilledIntoFocusedField(autofill::FillingStatus status) override;
void RefreshSuggestionsForField( void RefreshSuggestionsForField(
const url::Origin& origin,
autofill::mojom::FocusedFieldType focused_field_type, autofill::mojom::FocusedFieldType focused_field_type,
bool is_manual_generation_available) override; bool is_manual_generation_available) override;
void DidNavigateMainFrame() override; void DidNavigateMainFrame() override;
......
...@@ -175,7 +175,6 @@ TEST_F(PasswordAccessoryControllerTest, TransformsMatchesToSuggestions) { ...@@ -175,7 +175,6 @@ TEST_F(PasswordAccessoryControllerTest, TransformsMatchesToSuggestions) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -197,7 +196,6 @@ TEST_F(PasswordAccessoryControllerTest, HintsToEmptyUserNames) { ...@@ -197,7 +196,6 @@ TEST_F(PasswordAccessoryControllerTest, HintsToEmptyUserNames) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -237,7 +235,6 @@ TEST_F(PasswordAccessoryControllerTest, SortsAlphabeticalDuringTransform) { ...@@ -237,7 +235,6 @@ TEST_F(PasswordAccessoryControllerTest, SortsAlphabeticalDuringTransform) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -261,7 +258,6 @@ TEST_F(PasswordAccessoryControllerTest, RepeatsSuggestionsForSameFrame) { ...@@ -261,7 +258,6 @@ TEST_F(PasswordAccessoryControllerTest, RepeatsSuggestionsForSameFrame) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -279,7 +275,6 @@ TEST_F(PasswordAccessoryControllerTest, ProvidesEmptySuggestionsMessage) { ...@@ -279,7 +275,6 @@ TEST_F(PasswordAccessoryControllerTest, ProvidesEmptySuggestionsMessage) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -317,7 +312,6 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) { ...@@ -317,7 +312,6 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -337,7 +331,6 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) { ...@@ -337,7 +331,6 @@ TEST_F(PasswordAccessoryControllerTest, PasswordFieldChangesSuggestionType) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
ShowWhenKeyboardIsVisible(FillingSource::PASSWORD_FALLBACKS)); ShowWhenKeyboardIsVisible(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillablePasswordField, FocusedFieldType::kFillablePasswordField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -359,7 +352,6 @@ TEST_F(PasswordAccessoryControllerTest, CachesIsReplacedByNewPasswords) { ...@@ -359,7 +352,6 @@ TEST_F(PasswordAccessoryControllerTest, CachesIsReplacedByNewPasswords) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -379,7 +371,6 @@ TEST_F(PasswordAccessoryControllerTest, CachesIsReplacedByNewPasswords) { ...@@ -379,7 +371,6 @@ TEST_F(PasswordAccessoryControllerTest, CachesIsReplacedByNewPasswords) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -403,7 +394,6 @@ TEST_F(PasswordAccessoryControllerTest, UnfillableFieldClearsSuggestions) { ...@@ -403,7 +394,6 @@ TEST_F(PasswordAccessoryControllerTest, UnfillableFieldClearsSuggestions) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -418,7 +408,6 @@ TEST_F(PasswordAccessoryControllerTest, UnfillableFieldClearsSuggestions) { ...@@ -418,7 +408,6 @@ TEST_F(PasswordAccessoryControllerTest, UnfillableFieldClearsSuggestions) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kUnfillableElement, FocusedFieldType::kUnfillableElement,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -442,7 +431,6 @@ TEST_F(PasswordAccessoryControllerTest, NavigatingMainFrameClearsSuggestions) { ...@@ -442,7 +431,6 @@ TEST_F(PasswordAccessoryControllerTest, NavigatingMainFrameClearsSuggestions) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -460,7 +448,6 @@ TEST_F(PasswordAccessoryControllerTest, NavigatingMainFrameClearsSuggestions) { ...@@ -460,7 +448,6 @@ TEST_F(PasswordAccessoryControllerTest, NavigatingMainFrameClearsSuggestions) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL("https://random.other-site.org/")),
FocusedFieldType::kUnfillableElement, FocusedFieldType::kUnfillableElement,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
} }
...@@ -474,7 +461,6 @@ TEST_F(PasswordAccessoryControllerTest, FetchFaviconForCurrentUrl) { ...@@ -474,7 +461,6 @@ TEST_F(PasswordAccessoryControllerTest, FetchFaviconForCurrentUrl) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -502,7 +488,6 @@ TEST_F(PasswordAccessoryControllerTest, RequestsFaviconsOnceForOneOrigin) { ...@@ -502,7 +488,6 @@ TEST_F(PasswordAccessoryControllerTest, RequestsFaviconsOnceForOneOrigin) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -550,7 +535,6 @@ TEST_F(PasswordAccessoryControllerTest, FaviconsAreCachedUntilNavigation) { ...@@ -550,7 +535,6 @@ TEST_F(PasswordAccessoryControllerTest, FaviconsAreCachedUntilNavigation) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -586,7 +570,6 @@ TEST_F(PasswordAccessoryControllerTest, FaviconsAreCachedUntilNavigation) { ...@@ -586,7 +570,6 @@ TEST_F(PasswordAccessoryControllerTest, FaviconsAreCachedUntilNavigation) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/false); /*is_manual_generation_available=*/false);
...@@ -615,7 +598,6 @@ TEST_F(PasswordAccessoryControllerTest, NoFaviconCallbacksWhenOriginChanges) { ...@@ -615,7 +598,6 @@ TEST_F(PasswordAccessoryControllerTest, NoFaviconCallbacksWhenOriginChanges) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, false); FocusedFieldType::kFillableUsernameField, false);
// Right after starting the favicon request for example.com, a navigation // Right after starting the favicon request for example.com, a navigation
...@@ -642,7 +624,6 @@ TEST_F(PasswordAccessoryControllerTest, NoFaviconCallbacksWhenOriginChanges) { ...@@ -642,7 +624,6 @@ TEST_F(PasswordAccessoryControllerTest, NoFaviconCallbacksWhenOriginChanges) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL("https://other.frame.com/")),
FocusedFieldType::kFillableUsernameField, false); FocusedFieldType::kFillableUsernameField, false);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
...@@ -665,7 +646,6 @@ TEST_F(PasswordAccessoryControllerTest, AddsGenerationCommandWhenAvailable) { ...@@ -665,7 +646,6 @@ TEST_F(PasswordAccessoryControllerTest, AddsGenerationCommandWhenAvailable) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
ShowWhenKeyboardIsVisible(FillingSource::PASSWORD_FALLBACKS)); ShowWhenKeyboardIsVisible(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillablePasswordField, FocusedFieldType::kFillablePasswordField,
/*is_manual_generation_available=*/true); /*is_manual_generation_available=*/true);
} }
...@@ -682,7 +662,6 @@ TEST_F(PasswordAccessoryControllerTest, NoGenerationCommandIfNotPasswordField) { ...@@ -682,7 +662,6 @@ TEST_F(PasswordAccessoryControllerTest, NoGenerationCommandIfNotPasswordField) {
EXPECT_CALL(mock_manual_filling_controller_, EXPECT_CALL(mock_manual_filling_controller_,
Hide(FillingSource::PASSWORD_FALLBACKS)); Hide(FillingSource::PASSWORD_FALLBACKS));
controller()->RefreshSuggestionsForField( controller()->RefreshSuggestionsForField(
url::Origin::Create(GURL(kExampleSite)),
FocusedFieldType::kFillableUsernameField, FocusedFieldType::kFillableUsernameField,
/*is_manual_generation_available=*/true); /*is_manual_generation_available=*/true);
} }
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