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" | |
Peter Kasting
2015/02/16 20:37:07
Nit: This #include isn't needed, the type in quest
melandory
2015/02/17 16:16:58
Done.
| |
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. | |
Peter Kasting
2015/02/16 20:37:07
This comment doesn't sound correct. It sounds lik
melandory
2015/02/17 16:16:58
Done.
| |
26 class AccountChooserInfoBarDelegateAndroid : public infobars::InfoBarDelegate { | |
27 public: | |
28 // Creates and shows the infobar. Implemented in the platform-specific file. | |
Peter Kasting
2015/02/16 20:37:07
Nit: Please follow other infobar delegates' commen
melandory
2015/02/17 16:16:58
Done.
| |
29 static void Create(content::WebContents* web_contents, | |
Peter Kasting
2015/02/16 20:37:07
Pass an InfoBarService* instead of a WebContents*.
melandory
2015/02/17 16:16:58
Done.
| |
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, | |
Peter Kasting
2015/02/16 20:37:07
"unsigned int" is banned by the Google style guide
melandory
2015/02/17 16:16:57
Done.
| |
39 password_manager::CredentialType credential_type); | |
40 | |
41 private: | |
42 explicit AccountChooserInfoBarDelegateAndroid( | |
43 ManagePasswordsUIController* ui_controller); | |
44 | |
45 // InfoBarDelegate implementation: | |
Peter Kasting
2015/02/16 20:37:07
Nit: Prefix "InfoBarDelegate" with "infobars::" an
melandory
2015/02/17 16:16:58
Done.
| |
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. | |
Peter Kasting
2015/02/16 20:37:07
Nit: This comment sounds like it belongs in Manage
melandory
2015/02/17 16:16:58
Removed it for now.
| |
53 // AccountChooserInfoBarDelegateAndroid doesn't own this pointer. | |
Peter Kasting
2015/02/16 20:37:07
So who does own it? "Owned by ____" would be shor
melandory
2015/02/17 16:16:58
Done.
| |
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 |