| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_infobar_delega
te.h" | 5 #import "ios/chrome/browser/passwords/ios_chrome_password_manager_infobar_delega
te.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "components/password_manager/core/browser/password_form_manager.h" | 11 #include "components/password_manager/core/browser/password_form_manager.h" |
| 12 #include "components/password_manager/core/browser/password_manager_constants.h" | 12 #include "components/password_manager/core/browser/password_manager_constants.h" |
| 13 #include "components/strings/grit/components_strings.h" | 13 #include "components/strings/grit/components_strings.h" |
| 14 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" | 14 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" |
| 15 #import "ios/chrome/browser/ui/commands/open_url_command.h" | 15 #import "ios/chrome/browser/ui/commands/open_url_command.h" |
| 16 #include "ios/chrome/grit/ios_strings.h" | 16 #include "ios/chrome/grit/ios_strings.h" |
| 17 #include "ios/chrome/grit/ios_theme_resources.h" | 17 #include "ios/chrome/grit/ios_theme_resources.h" |
| 18 #include "ios/web/public/referrer.h" | 18 #include "ios/web/public/referrer.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 21 | 21 |
| 22 IOSChromePasswordManagerInfoBarDelegate:: | 22 IOSChromePasswordManagerInfoBarDelegate:: |
| 23 ~IOSChromePasswordManagerInfoBarDelegate() { | 23 ~IOSChromePasswordManagerInfoBarDelegate() { |
| 24 password_manager::metrics_util::LogUIDismissalReason(infobar_response_); | 24 password_manager::metrics_util::LogUIDismissalReason(infobar_response_); |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 IOSChromePasswordManagerInfoBarDelegate:: | 27 IOSChromePasswordManagerInfoBarDelegate:: |
| 28 IOSChromePasswordManagerInfoBarDelegate( | 28 IOSChromePasswordManagerInfoBarDelegate( |
| 29 bool is_smart_lock_branding_enabled, | 29 bool is_smart_lock_branding_enabled, |
| 30 std::unique_ptr<password_manager::PasswordFormManager> form_to_save) | 30 scoped_refptr<password_manager::PasswordFormManager> form_to_save) |
| 31 : form_to_save_(std::move(form_to_save)), | 31 : form_to_save_(std::move(form_to_save)), |
| 32 infobar_response_(password_manager::metrics_util::NO_DIRECT_INTERACTION), | 32 infobar_response_(password_manager::metrics_util::NO_DIRECT_INTERACTION), |
| 33 is_smart_lock_branding_enabled_(is_smart_lock_branding_enabled) {} | 33 is_smart_lock_branding_enabled_(is_smart_lock_branding_enabled) {} |
| 34 | 34 |
| 35 infobars::InfoBarDelegate::Type | 35 infobars::InfoBarDelegate::Type |
| 36 IOSChromePasswordManagerInfoBarDelegate::GetInfoBarType() const { | 36 IOSChromePasswordManagerInfoBarDelegate::GetInfoBarType() const { |
| 37 return PAGE_ACTION_TYPE; | 37 return PAGE_ACTION_TYPE; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 base::string16 IOSChromePasswordManagerInfoBarDelegate::GetLinkText() const { | 40 base::string16 IOSChromePasswordManagerInfoBarDelegate::GetLinkText() const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 52 base::scoped_nsobject<OpenUrlCommand> command([[OpenUrlCommand alloc] | 52 base::scoped_nsobject<OpenUrlCommand> command([[OpenUrlCommand alloc] |
| 53 initWithURL:GURL(password_manager::kPasswordManagerHelpCenterSmartLock) | 53 initWithURL:GURL(password_manager::kPasswordManagerHelpCenterSmartLock) |
| 54 referrer:web::Referrer() | 54 referrer:web::Referrer() |
| 55 inIncognito:NO | 55 inIncognito:NO |
| 56 inBackground:NO | 56 inBackground:NO |
| 57 appendTo:kCurrentTab]); | 57 appendTo:kCurrentTab]); |
| 58 UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow]; | 58 UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow]; |
| 59 [mainWindow chromeExecuteCommand:command]; | 59 [mainWindow chromeExecuteCommand:command]; |
| 60 return true; | 60 return true; |
| 61 }; | 61 }; |
| OLD | NEW |