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 "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 std::move(form_to_save)); | 233 std::move(form_to_save)); |
234 } | 234 } |
235 } else { | 235 } else { |
236 #if defined(OS_MACOSX) || BUILDFLAG(ANDROID_JAVA_UI) | 236 #if defined(OS_MACOSX) || BUILDFLAG(ANDROID_JAVA_UI) |
237 if (form_to_save->IsBlacklisted()) | 237 if (form_to_save->IsBlacklisted()) |
238 return false; | 238 return false; |
239 std::string uma_histogram_suffix( | 239 std::string uma_histogram_suffix( |
240 password_manager::metrics_util::GroupIdToString( | 240 password_manager::metrics_util::GroupIdToString( |
241 password_manager::metrics_util::MonitoredDomainGroupId( | 241 password_manager::metrics_util::MonitoredDomainGroupId( |
242 form_to_save->pending_credentials().signon_realm, GetPrefs()))); | 242 form_to_save->pending_credentials().signon_realm, GetPrefs()))); |
243 SavePasswordInfoBarDelegate::Create( | 243 SavePasswordInfoBarDelegate::Create(web_contents(), std::move(form_to_save), |
244 web_contents(), form_to_save.Pass(), uma_histogram_suffix, type); | 244 uma_histogram_suffix, type); |
245 #else | 245 #else |
246 NOTREACHED() << "Aura platforms should always use the bubble"; | 246 NOTREACHED() << "Aura platforms should always use the bubble"; |
247 #endif | 247 #endif |
248 } | 248 } |
249 return true; | 249 return true; |
250 } | 250 } |
251 | 251 |
252 bool ChromePasswordManagerClient::PromptUserToChooseCredentials( | 252 bool ChromePasswordManagerClient::PromptUserToChooseCredentials( |
253 ScopedVector<autofill::PasswordForm> local_forms, | 253 ScopedVector<autofill::PasswordForm> local_forms, |
254 ScopedVector<autofill::PasswordForm> federated_forms, | 254 ScopedVector<autofill::PasswordForm> federated_forms, |
255 const GURL& origin, | 255 const GURL& origin, |
256 base::Callback<void(const password_manager::CredentialInfo&)> callback) { | 256 base::Callback<void(const password_manager::CredentialInfo&)> callback) { |
257 #if defined(OS_ANDROID) | 257 #if defined(OS_ANDROID) |
258 // Deletes itself on the event from Java counterpart, when user interacts with | 258 // Deletes itself on the event from Java counterpart, when user interacts with |
259 // dialog. | 259 // dialog. |
260 AccountChooserDialogAndroid* acccount_chooser_dialog = | 260 AccountChooserDialogAndroid* acccount_chooser_dialog = |
261 new AccountChooserDialogAndroid(web_contents(), local_forms.Pass(), | 261 new AccountChooserDialogAndroid(web_contents(), std::move(local_forms), |
262 federated_forms.Pass(), origin, callback); | 262 std::move(federated_forms), origin, |
| 263 callback); |
263 acccount_chooser_dialog->ShowDialog(); | 264 acccount_chooser_dialog->ShowDialog(); |
264 return true; | 265 return true; |
265 #else | 266 #else |
266 return PasswordsClientUIDelegateFromWebContents(web_contents()) | 267 return PasswordsClientUIDelegateFromWebContents(web_contents()) |
267 ->OnChooseCredentials(std::move(local_forms), std::move(federated_forms), | 268 ->OnChooseCredentials(std::move(local_forms), std::move(federated_forms), |
268 origin, callback); | 269 origin, callback); |
269 #endif | 270 #endif |
270 } | 271 } |
271 | 272 |
272 void ChromePasswordManagerClient::ForceSavePassword() { | 273 void ChromePasswordManagerClient::ForceSavePassword() { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 545 |
545 const password_manager::CredentialsFilter* | 546 const password_manager::CredentialsFilter* |
546 ChromePasswordManagerClient::GetStoreResultFilter() const { | 547 ChromePasswordManagerClient::GetStoreResultFilter() const { |
547 return &credentials_filter_; | 548 return &credentials_filter_; |
548 } | 549 } |
549 | 550 |
550 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() | 551 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() |
551 const { | 552 const { |
552 return log_manager_.get(); | 553 return log_manager_.get(); |
553 } | 554 } |
OLD | NEW |