OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/chrome/browser/passwords/ios_chrome_password_manager_client.h" | 5 #import "ios/chrome/browser/passwords/ios_chrome_password_manager_client.h" |
6 | 6 |
| 7 #include <memory> |
7 #include <utility> | 8 #include <utility> |
8 | 9 |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
11 #include "components/browser_sync/browser/profile_sync_service.h" | 11 #include "components/browser_sync/browser/profile_sync_service.h" |
12 #include "components/keyed_service/core/service_access_type.h" | 12 #include "components/keyed_service/core/service_access_type.h" |
13 #include "components/password_manager/core/browser/password_form_manager.h" | 13 #include "components/password_manager/core/browser/password_form_manager.h" |
14 #include "components/password_manager/core/browser/password_manager_util.h" | 14 #include "components/password_manager/core/browser/password_manager_util.h" |
15 #include "components/password_manager/core/common/password_manager_pref_names.h" | 15 #include "components/password_manager/core/common/password_manager_pref_names.h" |
16 #include "components/signin/core/browser/signin_manager_base.h" | 16 #include "components/signin/core/browser/signin_manager_base.h" |
17 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 17 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
18 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" | 18 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" |
19 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 19 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 bool IOSChromePasswordManagerClient::PromptUserToChooseCredentials( | 62 bool IOSChromePasswordManagerClient::PromptUserToChooseCredentials( |
63 ScopedVector<autofill::PasswordForm> local_forms, | 63 ScopedVector<autofill::PasswordForm> local_forms, |
64 ScopedVector<autofill::PasswordForm> federated_forms, | 64 ScopedVector<autofill::PasswordForm> federated_forms, |
65 const GURL& origin, | 65 const GURL& origin, |
66 const CredentialsCallback& callback) { | 66 const CredentialsCallback& callback) { |
67 NOTIMPLEMENTED(); | 67 NOTIMPLEMENTED(); |
68 return false; | 68 return false; |
69 } | 69 } |
70 | 70 |
71 bool IOSChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword( | 71 bool IOSChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword( |
72 scoped_ptr<PasswordFormManager> form_to_save, | 72 std::unique_ptr<PasswordFormManager> form_to_save, |
73 password_manager::CredentialSourceType type, | 73 password_manager::CredentialSourceType type, |
74 bool update_password) { | 74 bool update_password) { |
75 if (form_to_save->IsBlacklisted()) | 75 if (form_to_save->IsBlacklisted()) |
76 return false; | 76 return false; |
77 [delegate_ showSavePasswordInfoBar:std::move(form_to_save)]; | 77 [delegate_ showSavePasswordInfoBar:std::move(form_to_save)]; |
78 return true; | 78 return true; |
79 } | 79 } |
80 | 80 |
81 void IOSChromePasswordManagerClient::AutomaticPasswordSave( | 81 void IOSChromePasswordManagerClient::AutomaticPasswordSave( |
82 scoped_ptr<PasswordFormManager> saved_form_manager) { | 82 std::unique_ptr<PasswordFormManager> saved_form_manager) { |
83 NOTIMPLEMENTED(); | 83 NOTIMPLEMENTED(); |
84 } | 84 } |
85 | 85 |
86 bool IOSChromePasswordManagerClient::IsOffTheRecord() const { | 86 bool IOSChromePasswordManagerClient::IsOffTheRecord() const { |
87 return (delegate_.browserState)->IsOffTheRecord(); | 87 return (delegate_.browserState)->IsOffTheRecord(); |
88 } | 88 } |
89 | 89 |
90 PrefService* IOSChromePasswordManagerClient::GetPrefs() { | 90 PrefService* IOSChromePasswordManagerClient::GetPrefs() { |
91 return (delegate_.browserState)->GetPrefs(); | 91 return (delegate_.browserState)->GetPrefs(); |
92 } | 92 } |
93 | 93 |
94 PasswordStore* IOSChromePasswordManagerClient::GetPasswordStore() const { | 94 PasswordStore* IOSChromePasswordManagerClient::GetPasswordStore() const { |
95 return IOSChromePasswordStoreFactory::GetForBrowserState( | 95 return IOSChromePasswordStoreFactory::GetForBrowserState( |
96 delegate_.browserState, ServiceAccessType::EXPLICIT_ACCESS) | 96 delegate_.browserState, ServiceAccessType::EXPLICIT_ACCESS) |
97 .get(); | 97 .get(); |
98 } | 98 } |
99 | 99 |
100 void IOSChromePasswordManagerClient::NotifyUserAutoSignin( | 100 void IOSChromePasswordManagerClient::NotifyUserAutoSignin( |
101 ScopedVector<autofill::PasswordForm> local_forms, | 101 ScopedVector<autofill::PasswordForm> local_forms, |
102 const GURL& origin) {} | 102 const GURL& origin) {} |
103 | 103 |
104 void IOSChromePasswordManagerClient::NotifyUserCouldBeAutoSignedIn( | 104 void IOSChromePasswordManagerClient::NotifyUserCouldBeAutoSignedIn( |
105 scoped_ptr<autofill::PasswordForm> form) {} | 105 std::unique_ptr<autofill::PasswordForm> form) {} |
106 | 106 |
107 void IOSChromePasswordManagerClient::NotifySuccessfulLoginWithExistingPassword( | 107 void IOSChromePasswordManagerClient::NotifySuccessfulLoginWithExistingPassword( |
108 const autofill::PasswordForm& form) {} | 108 const autofill::PasswordForm& form) {} |
109 | 109 |
110 void IOSChromePasswordManagerClient::ForceSavePassword() { | 110 void IOSChromePasswordManagerClient::ForceSavePassword() { |
111 NOTIMPLEMENTED(); | 111 NOTIMPLEMENTED(); |
112 } | 112 } |
113 | 113 |
114 bool IOSChromePasswordManagerClient::IsSavingAndFillingEnabledForCurrentPage() | 114 bool IOSChromePasswordManagerClient::IsSavingAndFillingEnabledForCurrentPage() |
115 const { | 115 const { |
116 return *saving_passwords_enabled_ && !IsOffTheRecord() && | 116 return *saving_passwords_enabled_ && !IsOffTheRecord() && |
117 !DidLastPageLoadEncounterSSLErrors() && | 117 !DidLastPageLoadEncounterSSLErrors() && |
118 IsFillingEnabledForCurrentPage(); | 118 IsFillingEnabledForCurrentPage(); |
119 } | 119 } |
120 | 120 |
121 const GURL& IOSChromePasswordManagerClient::GetLastCommittedEntryURL() const { | 121 const GURL& IOSChromePasswordManagerClient::GetLastCommittedEntryURL() const { |
122 return delegate_.lastCommittedURL; | 122 return delegate_.lastCommittedURL; |
123 } | 123 } |
124 | 124 |
125 const password_manager::CredentialsFilter* | 125 const password_manager::CredentialsFilter* |
126 IOSChromePasswordManagerClient::GetStoreResultFilter() const { | 126 IOSChromePasswordManagerClient::GetStoreResultFilter() const { |
127 return &credentials_filter_; | 127 return &credentials_filter_; |
128 } | 128 } |
OLD | NEW |