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 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" | 5 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 ? CredentialType::CREDENTIAL_TYPE_LOCAL | 177 ? CredentialType::CREDENTIAL_TYPE_LOCAL |
178 : CredentialType::CREDENTIAL_TYPE_FEDERATED); | 178 : CredentialType::CREDENTIAL_TYPE_FEDERATED); |
179 STLDeleteElements(&local_results); | 179 STLDeleteElements(&local_results); |
180 STLDeleteElements(&federated_results); | 180 STLDeleteElements(&federated_results); |
181 SendCredential(pending_request_->id, info); | 181 SendCredential(pending_request_->id, info); |
182 return; | 182 return; |
183 } | 183 } |
184 | 184 |
185 if (pending_request_->zero_click_only || | 185 if (pending_request_->zero_click_only || |
186 !client_->PromptUserToChooseCredentials( | 186 !client_->PromptUserToChooseCredentials( |
187 local_results, federated_results, | 187 local_results, federated_results, pending_request_->origin, |
188 base::Bind(&CredentialManagerDispatcher::SendCredential, | 188 base::Bind(&CredentialManagerDispatcher::SendCredential, |
189 base::Unretained(this), pending_request_->id))) { | 189 base::Unretained(this), pending_request_->id))) { |
190 STLDeleteElements(&local_results); | 190 STLDeleteElements(&local_results); |
191 STLDeleteElements(&federated_results); | 191 STLDeleteElements(&federated_results); |
192 SendCredential(pending_request_->id, CredentialInfo()); | 192 SendCredential(pending_request_->id, CredentialInfo()); |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 PasswordStore* CredentialManagerDispatcher::GetPasswordStore() { | 196 PasswordStore* CredentialManagerDispatcher::GetPasswordStore() { |
197 return client_ ? client_->GetPasswordStore() : nullptr; | 197 return client_ ? client_->GetPasswordStore() : nullptr; |
(...skipping 22 matching lines...) Expand all Loading... |
220 DCHECK(pending_request_); | 220 DCHECK(pending_request_); |
221 DCHECK_EQ(pending_request_->id, request_id); | 221 DCHECK_EQ(pending_request_->id, request_id); |
222 web_contents()->GetRenderViewHost()->Send( | 222 web_contents()->GetRenderViewHost()->Send( |
223 new CredentialManagerMsg_SendCredential( | 223 new CredentialManagerMsg_SendCredential( |
224 web_contents()->GetRenderViewHost()->GetRoutingID(), | 224 web_contents()->GetRenderViewHost()->GetRoutingID(), |
225 pending_request_->id, info)); | 225 pending_request_->id, info)); |
226 pending_request_.reset(); | 226 pending_request_.reset(); |
227 } | 227 } |
228 | 228 |
229 } // namespace password_manager | 229 } // namespace password_manager |
OLD | NEW |