Chromium Code Reviews| 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 <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 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/experimental_flags.h" | |
| 18 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" | 19 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" |
| 19 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 20 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
| 20 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" | 21 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 | 23 |
| 23 using password_manager::PasswordFormManager; | 24 using password_manager::PasswordFormManager; |
| 24 using password_manager::PasswordStore; | 25 using password_manager::PasswordStore; |
| 25 using password_manager::PasswordSyncState; | 26 using password_manager::PasswordSyncState; |
| 26 | 27 |
| 27 namespace { | 28 namespace { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 NOTIMPLEMENTED(); | 68 NOTIMPLEMENTED(); |
| 68 return false; | 69 return false; |
| 69 } | 70 } |
| 70 | 71 |
| 71 bool IOSChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword( | 72 bool IOSChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword( |
| 72 std::unique_ptr<PasswordFormManager> form_to_save, | 73 std::unique_ptr<PasswordFormManager> form_to_save, |
| 73 password_manager::CredentialSourceType type, | 74 password_manager::CredentialSourceType type, |
| 74 bool update_password) { | 75 bool update_password) { |
| 75 if (form_to_save->IsBlacklisted()) | 76 if (form_to_save->IsBlacklisted()) |
| 76 return false; | 77 return false; |
| 77 [delegate_ showSavePasswordInfoBar:std::move(form_to_save)]; | 78 |
| 79 if (update_password) { | |
|
sdefresne
2016/07/05 16:51:18
I think this should be:
if (update_password && ex
Jackie Quinn
2016/07/06 07:14:27
Done.
| |
| 80 if (experimental_flags::IsUpdatePasswordUIEnabled()) { | |
| 81 [delegate_ showUpdatePasswordInfoBar:std::move(form_to_save)]; | |
| 82 } | |
| 83 } else { | |
| 84 [delegate_ showSavePasswordInfoBar:std::move(form_to_save)]; | |
| 85 } | |
| 86 | |
| 78 return true; | 87 return true; |
| 79 } | 88 } |
| 80 | 89 |
| 81 void IOSChromePasswordManagerClient::AutomaticPasswordSave( | 90 void IOSChromePasswordManagerClient::AutomaticPasswordSave( |
| 82 std::unique_ptr<PasswordFormManager> saved_form_manager) { | 91 std::unique_ptr<PasswordFormManager> saved_form_manager) { |
| 83 NOTIMPLEMENTED(); | 92 NOTIMPLEMENTED(); |
| 84 } | 93 } |
| 85 | 94 |
| 86 bool IOSChromePasswordManagerClient::IsOffTheRecord() const { | 95 bool IOSChromePasswordManagerClient::IsOffTheRecord() const { |
| 87 return (delegate_.browserState)->IsOffTheRecord(); | 96 return (delegate_.browserState)->IsOffTheRecord(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 } | 130 } |
| 122 | 131 |
| 123 const GURL& IOSChromePasswordManagerClient::GetLastCommittedEntryURL() const { | 132 const GURL& IOSChromePasswordManagerClient::GetLastCommittedEntryURL() const { |
| 124 return delegate_.lastCommittedURL; | 133 return delegate_.lastCommittedURL; |
| 125 } | 134 } |
| 126 | 135 |
| 127 const password_manager::CredentialsFilter* | 136 const password_manager::CredentialsFilter* |
| 128 IOSChromePasswordManagerClient::GetStoreResultFilter() const { | 137 IOSChromePasswordManagerClient::GetStoreResultFilter() const { |
| 129 return &credentials_filter_; | 138 return &credentials_filter_; |
| 130 } | 139 } |
| OLD | NEW |