Chromium Code Reviews| Index: chrome/browser/password_manager/account_chooser_infobar_delegate_android.h |
| diff --git a/chrome/browser/password_manager/account_chooser_infobar_delegate_android.h b/chrome/browser/password_manager/account_chooser_infobar_delegate_android.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..384f8652115cd3e1a2d16e6185cb6b501dd12187 |
| --- /dev/null |
| +++ b/chrome/browser/password_manager/account_chooser_infobar_delegate_android.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2015 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 CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_INFOBAR_DELEGATE_ANDROID_H_ |
| +#define CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_INFOBAR_DELEGATE_ANDROID_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/strings/string16.h" |
|
vabr (Chromium)
2015/02/04 08:43:07
Seems unused.
melandory
2015/02/04 15:58:49
Done.
|
| +#include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| +#include "components/infobars/core/infobar_delegate.h" |
| +#include "ui/gfx/range/range.h" |
|
vabr (Chromium)
2015/02/04 08:43:07
Also seems unused.
melandory
2015/02/04 15:58:50
Done.
|
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace password_manager { |
| +enum class CredentialType : unsigned int; |
| +} |
| + |
| +// Android-only infobar to notify that the generated password was saved. |
| +class AccountChooserInfoBarDelegateAndroid : public infobars::InfoBarDelegate { |
| + public: |
| + // Creates and shows the infobar. Implemented in the platform-specific file. |
| + static void Create(content::WebContents* web_contents, |
| + ManagePasswordsUIController* ui_controller); |
| + |
| + ~AccountChooserInfoBarDelegateAndroid() override = default; |
| + |
| + ScopedVector<autofill::PasswordForm>& local_credentials_forms() { |
|
vabr (Chromium)
2015/02/04 08:43:07
Please #include base/memory/scoped_vector.h and at
vabr (Chromium)
2015/02/04 08:43:07
Please make this a const method returning a const
melandory
2015/02/04 15:58:49
Done.
melandory
2015/02/04 15:58:50
Done.
|
| + return ui_controller_->local_credentials_forms(); |
| + } |
| + |
| + void choose_credential(unsigned int credential_index, |
| + password_manager::CredentialType credential_type); |
| + |
| + private: |
| + explicit AccountChooserInfoBarDelegateAndroid( |
| + ManagePasswordsUIController* ui_controller); |
| + |
| + // InfoBarDelegate implementation: |
| + virtual Type GetInfoBarType() const override; |
|
vabr (Chromium)
2015/02/04 08:43:07
Please drop "virtual".
See: "For clarity, use exa
melandory
2015/02/04 15:58:50
Done.
|
| + AccountChooserInfoBarDelegateAndroid* AsAccountChooserInfoBarDelegateAndroid() |
| + override; |
| + |
| + // TODO(melandory): It's look like that controller part can be separated from |
|
vabr (Chromium)
2015/02/04 08:43:08
Grammar + shortening:
It should be possible to sep
melandory
2015/02/04 15:58:49
Done.
|
| + // ManagePasswordsUIController, because it looks like it doing some desktop ui |
| + // work. |
| + ManagePasswordsUIController* ui_controller_; |
|
vabr (Chromium)
2015/02/04 08:43:07
Please note whether this is a weak pointer, or whe
melandory
2015/02/04 15:58:50
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(AccountChooserInfoBarDelegateAndroid); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PASSWORD_MANAGER_ACCOUNT_CHOOSER_INFOBAR_DELEGATE_ANDROID_H_ |