| Index: ios/chrome/browser/passwords/ios_chrome_password_manager_infobar_delegate.h
|
| diff --git a/ios/chrome/browser/passwords/ios_chrome_password_manager_infobar_delegate.h b/ios/chrome/browser/passwords/ios_chrome_password_manager_infobar_delegate.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9c63b68d52cf2f6312675727ebc8f4b3fd32ea27
|
| --- /dev/null
|
| +++ b/ios/chrome/browser/passwords/ios_chrome_password_manager_infobar_delegate.h
|
| @@ -0,0 +1,67 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_INFOBAR_DELEGATE_H_
|
| +#define IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_INFOBAR_DELEGATE_H_
|
| +
|
| +#include <memory>
|
| +
|
| +#include "base/macros.h"
|
| +#include "components/infobars/core/confirm_infobar_delegate.h"
|
| +#include "components/password_manager/core/browser/password_manager_metrics_util.h"
|
| +
|
| +namespace password_manager {
|
| +class PasswordFormManager;
|
| +}
|
| +
|
| +namespace infobars {
|
| +class InfoBarManager;
|
| +}
|
| +
|
| +// Base class for password manager infobar delegates, e.g.
|
| +// IOSChromeSavePasswordInfoBarDelegate and
|
| +// IOSChromeUpdatePasswordInfoBarDelegate. Provides link text and action for
|
| +// smart lock.
|
| +class IOSChromePasswordManagerInfoBarDelegate : public ConfirmInfoBarDelegate {
|
| + public:
|
| + ~IOSChromePasswordManagerInfoBarDelegate() override;
|
| +
|
| + protected:
|
| + IOSChromePasswordManagerInfoBarDelegate(
|
| + bool is_smart_lock_branding_enabled,
|
| + std::unique_ptr<password_manager::PasswordFormManager> form_manager);
|
| +
|
| + password_manager::PasswordFormManager* form_to_save() const {
|
| + return form_to_save_.get();
|
| + }
|
| +
|
| + bool is_smart_lock_branding_enabled() const {
|
| + return is_smart_lock_branding_enabled_;
|
| + }
|
| +
|
| + void set_infobar_response(
|
| + password_manager::metrics_util::UIDismissalReason response) {
|
| + infobar_response_ = response;
|
| + }
|
| +
|
| + private:
|
| + // ConfirmInfoBarDelegate implementation.
|
| + Type GetInfoBarType() const override;
|
| + base::string16 GetLinkText() const override;
|
| + int GetIconId() const override;
|
| + bool LinkClicked(WindowOpenDisposition disposition) override;
|
| +
|
| + // The password_manager::PasswordFormManager managing the form we're asking
|
| + // the user about, and should save as per their decision.
|
| + std::unique_ptr<password_manager::PasswordFormManager> form_to_save_;
|
| +
|
| + // Used to track the results we get from the info bar.
|
| + password_manager::metrics_util::UIDismissalReason infobar_response_;
|
| +
|
| + // Whether to show the password manager branded as Smart Lock.
|
| + const bool is_smart_lock_branding_enabled_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(IOSChromePasswordManagerInfoBarDelegate);
|
| +};
|
| +#endif // IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_INFOBAR_DELEGATE_H_
|
|
|