| 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 14 matching lines...) Expand all Loading... |
| 25 // provisional_save_manager_ because we just update it on success and so such | 25 // provisional_save_manager_ because we just update it on success and so such |
| 26 // forms never end up in an infobar. | 26 // forms never end up in an infobar. |
| 27 class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { | 27 class SavePasswordInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 28 public: | 28 public: |
| 29 // If we won't be showing the one-click signin infobar, creates a save | 29 // If we won't be showing the one-click signin infobar, creates a save |
| 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(content::WebContents* web_contents, | 35 static void Create( |
| 36 password_manager::PasswordFormManager* form_to_save, | 36 content::WebContents* web_contents, |
| 37 const std::string& uma_histogram_suffix); | 37 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
| 38 const std::string& uma_histogram_suffix); |
| 38 | 39 |
| 39 virtual ~SavePasswordInfoBarDelegate(); | 40 virtual ~SavePasswordInfoBarDelegate(); |
| 40 | 41 |
| 41 // Specifies whether additional authentication (as defined by the OS) should | 42 // Specifies whether additional authentication (as defined by the OS) should |
| 42 // be required before autofilling this password. | 43 // be required before autofilling this password. |
| 43 void SetUseAdditionalPasswordAuthentication( | 44 void SetUseAdditionalPasswordAuthentication( |
| 44 bool use_additional_authentication); | 45 bool use_additional_authentication); |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 SavePasswordInfoBarDelegate( | 48 SavePasswordInfoBarDelegate( |
| 48 password_manager::PasswordFormManager* form_to_save, | 49 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
| 49 const std::string& uma_histogram_suffix); | 50 const std::string& uma_histogram_suffix); |
| 50 | 51 |
| 51 // Returns a save password infobar that owns |delegate|. | 52 // Returns a save password infobar that owns |delegate|. |
| 52 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 53 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
| 53 scoped_ptr<SavePasswordInfoBarDelegate> delegate); | 54 scoped_ptr<SavePasswordInfoBarDelegate> delegate); |
| 54 | 55 |
| 55 // InfoBarDelegate | 56 // InfoBarDelegate |
| 56 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; | 57 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; |
| 57 | 58 |
| 58 // ConfirmInfoBarDelegate | 59 // ConfirmInfoBarDelegate |
| (...skipping 19 matching lines...) Expand all Loading... |
| 78 base::ElapsedTimer timer_; | 79 base::ElapsedTimer timer_; |
| 79 | 80 |
| 80 // The group name corresponding to the domain name of |form_to_save_| if the | 81 // The group name corresponding to the domain name of |form_to_save_| if the |
| 81 // form is on a monitored domain. Otherwise, an empty string. | 82 // form is on a monitored domain. Otherwise, an empty string. |
| 82 const std::string uma_histogram_suffix_; | 83 const std::string uma_histogram_suffix_; |
| 83 | 84 |
| 84 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); | 85 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 88 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
| OLD | NEW |