diff options
16 files changed, 106 insertions, 46 deletions
diff --git a/components/password_manager/content/browser/credential_manager_dispatcher.cc b/components/password_manager/content/browser/credential_manager_dispatcher.cc index 708a95b..74950e7 100644 --- a/components/password_manager/content/browser/credential_manager_dispatcher.cc +++ b/components/password_manager/content/browser/credential_manager_dispatcher.cc @@ -144,6 +144,7 @@ void CredentialManagerDispatcher::ScheduleRequireMediationTask( void CredentialManagerDispatcher::OnRequestCredential( int request_id, bool zero_click_only, + bool include_passwords, const std::vector<GURL>& federations) { DCHECK(request_id); PasswordStore* store = GetPasswordStore(); @@ -173,24 +174,25 @@ void CredentialManagerDispatcher::OnRequestCredential( GetSynthesizedFormForOrigin(), base::Bind(&CredentialManagerDispatcher::ScheduleRequestTask, weak_factory_.GetWeakPtr(), request_id, zero_click_only, - federations)); + include_passwords, federations)); } else { std::vector<std::string> no_affiliated_realms; - ScheduleRequestTask(request_id, zero_click_only, federations, - no_affiliated_realms); + ScheduleRequestTask(request_id, zero_click_only, include_passwords, + federations, no_affiliated_realms); } } void CredentialManagerDispatcher::ScheduleRequestTask( int request_id, bool zero_click_only, + bool include_passwords, const std::vector<GURL>& federations, const std::vector<std::string>& android_realms) { DCHECK(GetPasswordStore()); pending_request_.reset(new CredentialManagerPendingRequestTask( this, request_id, zero_click_only, - web_contents()->GetLastCommittedURL().GetOrigin(), federations, - android_realms)); + web_contents()->GetLastCommittedURL().GetOrigin(), include_passwords, + federations, android_realms)); // This will result in a callback to // PendingRequestTask::OnGetPasswordStoreResults(). diff --git a/components/password_manager/content/browser/credential_manager_dispatcher.h b/components/password_manager/content/browser/credential_manager_dispatcher.h index 3093293..4747736 100644 --- a/components/password_manager/content/browser/credential_manager_dispatcher.h +++ b/components/password_manager/content/browser/credential_manager_dispatcher.h @@ -58,6 +58,7 @@ class CredentialManagerDispatcher // while processing the request. virtual void OnRequestCredential(int request_id, bool zero_click_only, + bool include_passwords, const std::vector<GURL>& federations); // content::WebContentsObserver implementation. @@ -90,6 +91,7 @@ class CredentialManagerDispatcher // grabs a list of realms related to the current web origin. void ScheduleRequestTask(int request_id, bool zero_click_only, + bool include_passwords, const std::vector<GURL>& federations, const std::vector<std::string>& android_realms); diff --git a/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc b/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc index 9cd39dc..676c571 100644 --- a/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc +++ b/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc @@ -272,7 +272,7 @@ class CredentialManagerDispatcherTest base::get<1>(send_param).type); } - void ExpectZeroClickSignInSuccess() { + void ExpectZeroClickSignInSuccess(CredentialType type) { EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _)) .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)) @@ -287,8 +287,7 @@ class CredentialManagerDispatcherTest CredentialManagerMsg_SendCredential::Param send_param; CredentialManagerMsg_SendCredential::Read(message, &send_param); - EXPECT_EQ(CredentialType::CREDENTIAL_TYPE_PASSWORD, - base::get<1>(send_param).type); + EXPECT_EQ(type, base::get<1>(send_param).type); } CredentialManagerDispatcher* dispatcher() { return dispatcher_.get(); } @@ -510,7 +509,7 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, false, federations); + dispatcher()->OnRequestCredential(kRequestId, false, true, federations); RunAllPendingTasks(); @@ -536,7 +535,7 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, false, federations); + dispatcher()->OnRequestCredential(kRequestId, false, true, federations); RunAllPendingTasks(); @@ -560,7 +559,7 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(1)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, false, federations); + dispatcher()->OnRequestCredential(kRequestId, false, true, federations); RunAllPendingTasks(); @@ -578,7 +577,7 @@ TEST_F( .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); RunAllPendingTasks(); @@ -600,9 +599,52 @@ TEST_F(CredentialManagerDispatcherTest, std::vector<GURL> federations; EXPECT_CALL(*client_, NotifyUserAutoSigninBlockedOnFirstRunPtr(_)).Times(0); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); + + ExpectZeroClickSignInSuccess(CredentialType::CREDENTIAL_TYPE_PASSWORD); +} + +TEST_F(CredentialManagerDispatcherTest, + CredentialManagerOnRequestCredentialWithoutPasswords) { + store_->AddLogin(form_); + client_->set_first_run_seen(true); + + std::vector<GURL> federations; - ExpectZeroClickSignInSuccess(); + EXPECT_CALL(*client_, NotifyUserAutoSigninBlockedOnFirstRunPtr(_)).Times(0); + dispatcher()->OnRequestCredential(kRequestId, true, false, federations); + + ExpectZeroClickSignInFailure(); +} + +TEST_F(CredentialManagerDispatcherTest, + CredentialManagerOnRequestCredentialFederatedMatch) { + form_.federation_url = GURL("https://example.com/"); + store_->AddLogin(form_); + client_->set_first_run_seen(true); + + std::vector<GURL> federations; + federations.push_back(GURL("https://example.com/")); + + EXPECT_CALL(*client_, NotifyUserAutoSigninBlockedOnFirstRunPtr(_)).Times(0); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); + + ExpectZeroClickSignInSuccess(CredentialType::CREDENTIAL_TYPE_FEDERATED); +} + +TEST_F(CredentialManagerDispatcherTest, + CredentialManagerOnRequestCredentialFederatedNoMatch) { + form_.federation_url = GURL("https://example.com/"); + store_->AddLogin(form_); + client_->set_first_run_seen(true); + + std::vector<GURL> federations; + federations.push_back(GURL("https://not-example.com/")); + + EXPECT_CALL(*client_, NotifyUserAutoSigninBlockedOnFirstRunPtr(_)).Times(0); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); + + ExpectZeroClickSignInFailure(); } TEST_F(CredentialManagerDispatcherTest, RequestCredentialWithoutFirstRun) { @@ -614,7 +656,7 @@ TEST_F(CredentialManagerDispatcherTest, RequestCredentialWithoutFirstRun) { EXPECT_CALL(*client_, NotifyUserAutoSigninBlockedOnFirstRunPtr(testing::Pointee(form_))) .Times(1); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); ExpectZeroClickSignInFailure(); } @@ -627,7 +669,7 @@ TEST_F(CredentialManagerDispatcherTest, RequestCredentialWithTLSErrors) { store_->AddLogin(form_); std::vector<GURL> federations; - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); ExpectZeroClickSignInFailure(); } @@ -642,7 +684,7 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); RunAllPendingTasks(); @@ -669,7 +711,7 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); RunAllPendingTasks(); @@ -698,7 +740,7 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); RunAllPendingTasks(); @@ -725,8 +767,8 @@ TEST_F(CredentialManagerDispatcherTest, .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, false, federations); - dispatcher()->OnRequestCredential(kRequestId + 1, false, federations); + dispatcher()->OnRequestCredential(kRequestId, false, true, federations); + dispatcher()->OnRequestCredential(kRequestId + 1, false, true, federations); // Check that the second request triggered a rejection. uint32_t kMsgID = CredentialManagerMsg_RejectCredentialRequest::ID; @@ -791,7 +833,7 @@ TEST_F(CredentialManagerDispatcherTest, ResetSkipZeroClickAfterPrompt) { .Times(testing::Exactly(1)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, false, federations); + dispatcher()->OnRequestCredential(kRequestId, false, true, federations); RunAllPendingTasks(); passwords = store_->stored_passwords(); @@ -811,7 +853,7 @@ TEST_F(CredentialManagerDispatcherTest, IncognitoZeroClickRequestCredential) { .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); RunAllPendingTasks(); @@ -840,9 +882,9 @@ TEST_F(CredentialManagerDispatcherTest, mock_helper->ExpectCallToGetAffiliatedAndroidRealms( dispatcher_->GetSynthesizedFormForOrigin(), affiliated_realms); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); - ExpectZeroClickSignInSuccess(); + ExpectZeroClickSignInSuccess(CredentialType::CREDENTIAL_TYPE_PASSWORD); } TEST_F(CredentialManagerDispatcherTest, @@ -862,7 +904,7 @@ TEST_F(CredentialManagerDispatcherTest, mock_helper->ExpectCallToGetAffiliatedAndroidRealms( dispatcher_->GetSynthesizedFormForOrigin(), affiliated_realms); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); ExpectZeroClickSignInFailure(); } @@ -882,7 +924,7 @@ TEST_F(CredentialManagerDispatcherTest, mock_helper->ExpectCallToGetAffiliatedAndroidRealms( dispatcher_->GetSynthesizedFormForOrigin(), affiliated_realms); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); ExpectZeroClickSignInFailure(); } @@ -903,9 +945,9 @@ TEST_F(CredentialManagerDispatcherTest, mock_helper->ExpectCallToGetAffiliatedAndroidRealms( dispatcher_->GetSynthesizedFormForOrigin(), affiliated_realms); - dispatcher()->OnRequestCredential(kRequestId, true, federations); + dispatcher()->OnRequestCredential(kRequestId, true, true, federations); - ExpectZeroClickSignInSuccess(); + ExpectZeroClickSignInSuccess(CredentialType::CREDENTIAL_TYPE_PASSWORD); } TEST_F(CredentialManagerDispatcherTest, GetSynthesizedFormForOrigin) { diff --git a/components/password_manager/content/common/credential_manager_messages.h b/components/password_manager/content/common/credential_manager_messages.h index 215a0f7..694e1e58 100644 --- a/components/password_manager/content/common/credential_manager_messages.h +++ b/components/password_manager/content/common/credential_manager_messages.h @@ -55,9 +55,10 @@ IPC_MESSAGE_ROUTED1(CredentialManagerHostMsg_RequireUserMediation, // Requests a credential from the browser process in response to a page calling // 'navigator.credentials.get()'. The browser process will respond with a // CredentialManagerMsg_SendCredential message. -IPC_MESSAGE_ROUTED3(CredentialManagerHostMsg_RequestCredential, +IPC_MESSAGE_ROUTED4(CredentialManagerHostMsg_RequestCredential, int /* request_id */, bool /* zero_click_only */, + bool /* include_passwords */, std::vector<GURL> /* federations */) // ---------------------------------------------------------------------------- diff --git a/components/password_manager/content/renderer/credential_manager_client.cc b/components/password_manager/content/renderer/credential_manager_client.cc index 2d887ad..7fe3ab5 100644 --- a/components/password_manager/content/renderer/credential_manager_client.cc +++ b/components/password_manager/content/renderer/credential_manager_client.cc @@ -123,7 +123,8 @@ void CredentialManagerClient::dispatchRequireUserMediation( } void CredentialManagerClient::dispatchGet( - bool zeroClickOnly, + bool zero_click_only, + bool include_passwords, const blink::WebVector<blink::WebURL>& federations, RequestCallbacks* callbacks) { int request_id = get_callbacks_.Add(callbacks); @@ -131,7 +132,8 @@ void CredentialManagerClient::dispatchGet( for (size_t i = 0; i < std::min(federations.size(), kMaxFederations); ++i) federation_vector.push_back(federations[i]); Send(new CredentialManagerHostMsg_RequestCredential( - routing_id(), request_id, zeroClickOnly, federation_vector)); + routing_id(), request_id, zero_click_only, include_passwords, + federation_vector)); } void CredentialManagerClient::RespondToNotificationCallback( diff --git a/components/password_manager/content/renderer/credential_manager_client.h b/components/password_manager/content/renderer/credential_manager_client.h index 81f3ed2..7696857 100644 --- a/components/password_manager/content/renderer/credential_manager_client.h +++ b/components/password_manager/content/renderer/credential_manager_client.h @@ -68,6 +68,7 @@ class CredentialManagerClient : public blink::WebCredentialManagerClient, WebCredentialManagerClient::NotificationCallbacks* callbacks) override; void dispatchRequireUserMediation(NotificationCallbacks* callbacks) override; void dispatchGet(bool zero_click_only, + bool include_passwords, const blink::WebVector<blink::WebURL>& federations, RequestCallbacks* callbacks) override; diff --git a/components/password_manager/content/renderer/credential_manager_client_browsertest.cc b/components/password_manager/content/renderer/credential_manager_client_browsertest.cc index 0fda08b..cb8c750 100644 --- a/components/password_manager/content/renderer/credential_manager_client_browsertest.cc +++ b/components/password_manager/content/renderer/credential_manager_client_browsertest.cc @@ -70,7 +70,7 @@ class CredentialManagerClientTest : public content::RenderViewTest { } case CredentialManagerHostMsg_RequestCredential::ID: { - base::Tuple<int, bool, std::vector<GURL>> param; + base::Tuple<int, bool, bool, std::vector<GURL>> param; CredentialManagerHostMsg_RequestCredential::Read(message, ¶m); request_id = base::get<0>(param); break; @@ -182,7 +182,7 @@ TEST_F(CredentialManagerClientTest, SendRequestCredential) { scoped_ptr<TestRequestCallbacks> callbacks(new TestRequestCallbacks(this)); std::vector<GURL> federations; - client_->dispatchGet(false, federations, callbacks.release()); + client_->dispatchGet(false, true, federations, callbacks.release()); EXPECT_TRUE(ExtractRequestId(CredentialManagerHostMsg_RequestCredential::ID, request_id)); @@ -201,7 +201,7 @@ TEST_F(CredentialManagerClientTest, SendRequestCredentialEmpty) { scoped_ptr<TestRequestCallbacks> callbacks(new TestRequestCallbacks(this)); std::vector<GURL> federations; - client_->dispatchGet(false, federations, callbacks.release()); + client_->dispatchGet(false, true, federations, callbacks.release()); EXPECT_TRUE(ExtractRequestId(CredentialManagerHostMsg_RequestCredential::ID, request_id)); diff --git a/components/password_manager/core/browser/credential_manager_pending_request_task.cc b/components/password_manager/core/browser/credential_manager_pending_request_task.cc index 4399dc3..6414ec3 100644 --- a/components/password_manager/core/browser/credential_manager_pending_request_task.cc +++ b/components/password_manager/core/browser/credential_manager_pending_request_task.cc @@ -21,16 +21,18 @@ CredentialManagerPendingRequestTask::CredentialManagerPendingRequestTask( int request_id, bool request_zero_click_only, const GURL& request_origin, + bool include_passwords, const std::vector<GURL>& request_federations, const std::vector<std::string>& affiliated_realms) : delegate_(delegate), id_(request_id), zero_click_only_(request_zero_click_only), origin_(request_origin), + include_passwords_(include_passwords), affiliated_realms_(affiliated_realms.begin(), affiliated_realms.end()) { CHECK(!delegate_->client()->DidLastPageLoadEncounterSSLErrors()); - for (const GURL& origin : request_federations) - federations_.insert(origin.spec()); + for (const GURL& federation : request_federations) + federations_.insert(federation.GetOrigin().spec()); } CredentialManagerPendingRequestTask::~CredentialManagerPendingRequestTask() = @@ -52,8 +54,12 @@ void CredentialManagerPendingRequestTask::OnGetPasswordStoreResults( // GURL definition: scheme, host, and port. // So we can't compare them directly. if (form->origin.GetOrigin() == origin_.GetOrigin()) { - local_results.push_back(form); - form = nullptr; + if ((form->federation_url.is_empty() && include_passwords_) || + (!form->federation_url.is_empty() && + federations_.count(form->federation_url.spec()))) { + local_results.push_back(form); + form = nullptr; + } } else if (affiliated_realms_.count(form->signon_realm) && AffiliatedMatchHelper::IsValidAndroidCredential(*form)) { form->is_affiliation_based_match = true; diff --git a/components/password_manager/core/browser/credential_manager_pending_request_task.h b/components/password_manager/core/browser/credential_manager_pending_request_task.h index 7ba9ea3..d69a3a3 100644 --- a/components/password_manager/core/browser/credential_manager_pending_request_task.h +++ b/components/password_manager/core/browser/credential_manager_pending_request_task.h @@ -52,6 +52,7 @@ class CredentialManagerPendingRequestTask : public PasswordStoreConsumer { int request_id, bool request_zero_click_only, const GURL& request_origin, + bool include_passwords, const std::vector<GURL>& request_federations, const std::vector<std::string>& affiliated_realms); ~CredentialManagerPendingRequestTask() override; @@ -68,6 +69,7 @@ class CredentialManagerPendingRequestTask : public PasswordStoreConsumer { const int id_; const bool zero_click_only_; const GURL origin_; + const bool include_passwords_; std::set<std::string> federations_; std::set<std::string> affiliated_realms_; diff --git a/components/test_runner/mock_credential_manager_client.cc b/components/test_runner/mock_credential_manager_client.cc index b5250ff..6b408fc 100644 --- a/components/test_runner/mock_credential_manager_client.cc +++ b/components/test_runner/mock_credential_manager_client.cc @@ -34,7 +34,8 @@ void MockCredentialManagerClient::dispatchRequireUserMediation( } void MockCredentialManagerClient::dispatchGet( - bool zeroClickOnly, + bool zero_click_only, + bool include_passwords, const blink::WebVector<blink::WebURL>& federations, RequestCallbacks* callbacks) { callbacks->onSuccess(adoptWebPtr(credential_.release())); diff --git a/components/test_runner/mock_credential_manager_client.h b/components/test_runner/mock_credential_manager_client.h index 2ac7034..f2556d29 100644 --- a/components/test_runner/mock_credential_manager_client.h +++ b/components/test_runner/mock_credential_manager_client.h @@ -31,6 +31,7 @@ class MockCredentialManagerClient : public blink::WebCredentialManagerClient { NotificationCallbacks* callbacks) override; void dispatchRequireUserMediation(NotificationCallbacks* callbacks) override; void dispatchGet(bool zero_click_only, + bool include_passwords, const blink::WebVector<blink::WebURL>& federations, RequestCallbacks* callbacks) override; diff --git a/ios/chrome/browser/passwords/credential_manager.mm b/ios/chrome/browser/passwords/credential_manager.mm index af0d394..9549c7e 100644 --- a/ios/chrome/browser/passwords/credential_manager.mm +++ b/ios/chrome/browser/passwords/credential_manager.mm @@ -160,7 +160,7 @@ void CredentialManager::CredentialsRequested( std::vector<std::string> realms; pending_request_.reset( new password_manager::CredentialManagerPendingRequestTask( - this, request_id, zero_click_only, page_url, federation_urls, + this, request_id, zero_click_only, page_url, true, federation_urls, realms)); store->GetAutofillableLogins(pending_request_.get()); } diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp index ecccb0a..0983d5d 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.cpp @@ -71,11 +71,11 @@ void CredentialManagerClient::dispatchRequireUserMediation(WebCredentialManagerC m_client->dispatchRequireUserMediation(callbacks); } -void CredentialManagerClient::dispatchGet(bool zeroClickOnly, const WebVector<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks* callbacks) +void CredentialManagerClient::dispatchGet(bool zeroClickOnly, bool includePasswords, const WebVector<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks* callbacks) { if (!m_client) return; - m_client->dispatchGet(zeroClickOnly, federations, callbacks); + m_client->dispatchGet(zeroClickOnly, includePasswords, federations, callbacks); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h index d7233f2..17f3b61 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialManagerClient.h @@ -37,7 +37,7 @@ public: virtual void dispatchFailedSignIn(const WebCredential&, WebCredentialManagerClient::NotificationCallbacks*); virtual void dispatchStore(const WebCredential&, WebCredentialManagerClient::NotificationCallbacks*); virtual void dispatchRequireUserMediation(WebCredentialManagerClient::NotificationCallbacks*); - virtual void dispatchGet(bool zeroClickOnly, const WebVector<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks*); + virtual void dispatchGet(bool zeroClickOnly, bool includePasswords, const WebVector<WebURL>& federations, WebCredentialManagerClient::RequestCallbacks*); private: WebCredentialManagerClient* m_client; diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp index 8bf590c..b07fc6dc 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp @@ -137,7 +137,7 @@ ScriptPromise CredentialsContainer::get(ScriptState* scriptState, const Credenti options.suppressUI() ? UseCounter::CredentialManagerGetWithoutUI : UseCounter::CredentialManagerGetWithUI); - CredentialManagerClient::from(scriptState->executionContext())->dispatchGet(options.suppressUI(), providers, new RequestCallbacks(resolver)); + CredentialManagerClient::from(scriptState->executionContext())->dispatchGet(options.suppressUI(), options.password(), providers, new RequestCallbacks(resolver)); return promise; } diff --git a/third_party/WebKit/public/platform/WebCredentialManagerClient.h b/third_party/WebKit/public/platform/WebCredentialManagerClient.h index a724e37..f9e8049 100644 --- a/third_party/WebKit/public/platform/WebCredentialManagerClient.h +++ b/third_party/WebKit/public/platform/WebCredentialManagerClient.h @@ -28,7 +28,7 @@ public: virtual void dispatchFailedSignIn(const WebCredential&, NotificationCallbacks*) { } virtual void dispatchStore(const WebCredential&, NotificationCallbacks*) { } virtual void dispatchRequireUserMediation(NotificationCallbacks*) { } - virtual void dispatchGet(bool zeroClickOnly, const WebVector<WebURL>& federations, RequestCallbacks*) { } + virtual void dispatchGet(bool zeroClickOnly, bool includePasswords, const WebVector<WebURL>& federations, RequestCallbacks*) {} }; } // namespace blink |