OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // password infobar and delegate and adds the infobar to the InfoBarService | 30 // password infobar and delegate and adds the infobar to the InfoBarService |
31 // for |web_contents|. |uma_histogram_suffix| is empty, or one of the | 31 // for |web_contents|. |uma_histogram_suffix| is empty, or one of the |
32 // "group_X" suffixes used in the histogram names for infobar usage reporting; | 32 // "group_X" suffixes used in the histogram names for infobar usage reporting; |
33 // if empty, the usage is not reported, otherwise the suffix is used to choose | 33 // if empty, the usage is not reported, otherwise the suffix is used to choose |
34 // the right histogram. | 34 // the right histogram. |
35 static void Create( | 35 static void Create( |
36 content::WebContents* web_contents, | 36 content::WebContents* web_contents, |
37 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 37 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
38 const std::string& uma_histogram_suffix); | 38 const std::string& uma_histogram_suffix); |
39 | 39 |
40 virtual ~SavePasswordInfoBarDelegate(); | |
41 | |
42 // Specifies whether additional authentication (as defined by the OS) should | |
43 // be required before autofilling this password. | |
44 void SetUseAdditionalPasswordAuthentication( | |
45 bool use_additional_authentication); | |
46 | |
47 private: | 40 private: |
48 SavePasswordInfoBarDelegate( | 41 SavePasswordInfoBarDelegate( |
49 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 42 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
50 const std::string& uma_histogram_suffix); | 43 const std::string& uma_histogram_suffix); |
51 | 44 |
52 // Returns a save password infobar that owns |delegate|. | 45 virtual ~SavePasswordInfoBarDelegate(); |
53 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | |
54 scoped_ptr<SavePasswordInfoBarDelegate> delegate); | |
55 | 46 |
56 // InfoBarDelegate | 47 // InfoBarDelegate |
57 virtual bool ShouldExpire(const NavigationDetails& details) const override; | 48 virtual bool ShouldExpire(const NavigationDetails& details) const override; |
58 | 49 |
59 // ConfirmInfoBarDelegate | 50 // ConfirmInfoBarDelegate |
60 virtual int GetIconID() const override; | 51 virtual int GetIconID() const override; |
61 virtual Type GetInfoBarType() const override; | 52 virtual Type GetInfoBarType() const override; |
62 virtual base::string16 GetMessageText() const override; | 53 virtual base::string16 GetMessageText() const override; |
63 virtual base::string16 GetButtonLabel(InfoBarButton button) const override; | 54 virtual base::string16 GetButtonLabel(InfoBarButton button) const override; |
64 virtual bool Accept() override; | 55 virtual bool Accept() override; |
(...skipping 14 matching lines...) Expand all Loading... |
79 base::ElapsedTimer timer_; | 70 base::ElapsedTimer timer_; |
80 | 71 |
81 // The group name corresponding to the domain name of |form_to_save_| if the | 72 // The group name corresponding to the domain name of |form_to_save_| if the |
82 // form is on a monitored domain. Otherwise, an empty string. | 73 // form is on a monitored domain. Otherwise, an empty string. |
83 const std::string uma_histogram_suffix_; | 74 const std::string uma_histogram_suffix_; |
84 | 75 |
85 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); | 76 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
86 }; | 77 }; |
87 | 78 |
88 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 79 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
OLD | NEW |