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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 839 |
840 #pragma mark - Private methods | 840 #pragma mark - Private methods |
841 | 841 |
842 - (void)showInfoBarForForm:(std::unique_ptr<PasswordFormManager>)form | 842 - (void)showInfoBarForForm:(std::unique_ptr<PasswordFormManager>)form |
843 infoBarType:(PasswordInfoBarType)type { | 843 infoBarType:(PasswordInfoBarType)type { |
844 if (!webStateObserverBridge_ || !webStateObserverBridge_->web_state()) | 844 if (!webStateObserverBridge_ || !webStateObserverBridge_->web_state()) |
845 return; | 845 return; |
846 | 846 |
847 bool isSmartLockBrandingEnabled = false; | 847 bool isSmartLockBrandingEnabled = false; |
848 if (self.browserState) { | 848 if (self.browserState) { |
849 sync_driver::SyncService* sync_service = | 849 syncer::SyncService* sync_service = |
850 IOSChromeProfileSyncServiceFactory::GetForBrowserState( | 850 IOSChromeProfileSyncServiceFactory::GetForBrowserState( |
851 self.browserState); | 851 self.browserState); |
852 isSmartLockBrandingEnabled = | 852 isSmartLockBrandingEnabled = |
853 password_bubble_experiment::IsSmartLockBrandingSavePromptEnabled( | 853 password_bubble_experiment::IsSmartLockBrandingSavePromptEnabled( |
854 sync_service); | 854 sync_service); |
855 } | 855 } |
856 infobars::InfoBarManager* infoBarManager = | 856 infobars::InfoBarManager* infoBarManager = |
857 InfoBarManagerImpl::FromWebState(webStateObserverBridge_->web_state()); | 857 InfoBarManagerImpl::FromWebState(webStateObserverBridge_->web_state()); |
858 | 858 |
859 switch (type) { | 859 switch (type) { |
860 case PasswordInfoBarType::SAVE: | 860 case PasswordInfoBarType::SAVE: |
861 IOSChromeSavePasswordInfoBarDelegate::Create( | 861 IOSChromeSavePasswordInfoBarDelegate::Create( |
862 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); | 862 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); |
863 break; | 863 break; |
864 | 864 |
865 case PasswordInfoBarType::UPDATE: | 865 case PasswordInfoBarType::UPDATE: |
866 IOSChromeUpdatePasswordInfoBarDelegate::Create( | 866 IOSChromeUpdatePasswordInfoBarDelegate::Create( |
867 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); | 867 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); |
868 break; | 868 break; |
869 } | 869 } |
870 } | 870 } |
871 | 871 |
872 @end | 872 @end |
OLD | NEW |