| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/password_controller.h" | 5 #import "ios/chrome/browser/passwords/password_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 infoBarType:(PasswordInfoBarType)type { | 855 infoBarType:(PasswordInfoBarType)type { |
| 856 if (!webStateObserverBridge_ || !webStateObserverBridge_->web_state()) | 856 if (!webStateObserverBridge_ || !webStateObserverBridge_->web_state()) |
| 857 return; | 857 return; |
| 858 | 858 |
| 859 bool isSmartLockBrandingEnabled = false; | 859 bool isSmartLockBrandingEnabled = false; |
| 860 if (self.browserState) { | 860 if (self.browserState) { |
| 861 syncer::SyncService* sync_service = | 861 syncer::SyncService* sync_service = |
| 862 IOSChromeProfileSyncServiceFactory::GetForBrowserState( | 862 IOSChromeProfileSyncServiceFactory::GetForBrowserState( |
| 863 self.browserState); | 863 self.browserState); |
| 864 isSmartLockBrandingEnabled = | 864 isSmartLockBrandingEnabled = |
| 865 password_bubble_experiment::IsSmartLockBrandingSavePromptEnabled( | 865 password_bubble_experiment::IsSmartLockUser(sync_service); |
| 866 sync_service); | |
| 867 } | 866 } |
| 868 infobars::InfoBarManager* infoBarManager = | 867 infobars::InfoBarManager* infoBarManager = |
| 869 InfoBarManagerImpl::FromWebState(webStateObserverBridge_->web_state()); | 868 InfoBarManagerImpl::FromWebState(webStateObserverBridge_->web_state()); |
| 870 | 869 |
| 871 switch (type) { | 870 switch (type) { |
| 872 case PasswordInfoBarType::SAVE: | 871 case PasswordInfoBarType::SAVE: |
| 873 IOSChromeSavePasswordInfoBarDelegate::Create( | 872 IOSChromeSavePasswordInfoBarDelegate::Create( |
| 874 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); | 873 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); |
| 875 break; | 874 break; |
| 876 | 875 |
| 877 case PasswordInfoBarType::UPDATE: | 876 case PasswordInfoBarType::UPDATE: |
| 878 IOSChromeUpdatePasswordInfoBarDelegate::Create( | 877 IOSChromeUpdatePasswordInfoBarDelegate::Create( |
| 879 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); | 878 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); |
| 880 break; | 879 break; |
| 881 } | 880 } |
| 882 } | 881 } |
| 883 | 882 |
| 884 @end | 883 @end |
| OLD | NEW |