| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_INFOBAR_DELEGATE_ANDROID
_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_INFOBAR_DELEGATE_ANDROID
_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" |
| 10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 11 #include "components/infobars/core/infobar_delegate.h" |
| 12 |
| 13 namespace content { |
| 14 class WebContents; |
| 15 } |
| 16 |
| 17 namespace password_manager { |
| 18 enum class CredentialType : unsigned int; |
| 19 } |
| 20 |
| 21 namespace autofill { |
| 22 struct PasswordForm; |
| 23 } |
| 24 |
| 25 // Android-only infobar to notify that the generated password was saved. |
| 26 class AccountChooserInfoBarDelegateAndroid : public infobars::InfoBarDelegate { |
| 27 public: |
| 28 // Creates and shows the infobar. Implemented in the platform-specific file. |
| 29 static void Create(content::WebContents* web_contents, |
| 30 ManagePasswordsUIController* ui_controller); |
| 31 |
| 32 ~AccountChooserInfoBarDelegateAndroid() override = default; |
| 33 |
| 34 const ScopedVector<autofill::PasswordForm>& local_credentials_forms() const { |
| 35 return ui_controller_->local_credentials_forms(); |
| 36 } |
| 37 |
| 38 void choose_credential(unsigned int credential_index, |
| 39 password_manager::CredentialType credential_type); |
| 40 |
| 41 private: |
| 42 explicit AccountChooserInfoBarDelegateAndroid( |
| 43 ManagePasswordsUIController* ui_controller); |
| 44 |
| 45 // InfoBarDelegate implementation: |
| 46 Type GetInfoBarType() const override; |
| 47 AccountChooserInfoBarDelegateAndroid* AsAccountChooserInfoBarDelegateAndroid() |
| 48 override; |
| 49 |
| 50 // TODO(melandory): It looks like ManagePasswordUIController has logic which |
| 51 // should be extracted from it (storing data, propagating user actions), as |
| 52 // for example TranslateUIDelegate does it. |
| 53 // AccountChooserInfoBarDelegateAndroid doesn't own this pointer. |
| 54 ManagePasswordsUIController* ui_controller_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(AccountChooserInfoBarDelegateAndroid); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_INFOBAR_DELEGATE_ANDR
OID_H_ |
| OLD | NEW |