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" |
11 #include "base/timer/elapsed_timer.h" | 11 #include "base/timer/elapsed_timer.h" |
12 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 12 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
13 #include "chrome/browser/infobars/infobar_delegate.h" | 13 #include "components/infobars/core/infobar_delegate.h" |
14 #include "components/password_manager/core/browser/password_form_manager.h" | 14 #include "components/password_manager/core/browser/password_form_manager.h" |
15 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 15 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class WebContents; | 18 class WebContents; |
19 } | 19 } |
20 | 20 |
21 // After a successful *new* login attempt, we take the PasswordFormManager in | 21 // After a successful *new* login attempt, we take the PasswordFormManager in |
22 // provisional_save_manager_ and move it to a SavePasswordInfoBarDelegate while | 22 // provisional_save_manager_ and move it to a SavePasswordInfoBarDelegate while |
23 // the user makes up their mind with the "save password" infobar. Note if the | 23 // the user makes up their mind with the "save password" infobar. Note if the |
(...skipping 18 matching lines...) Expand all Loading... |
42 // be required before autofilling this password. | 42 // be required before autofilling this password. |
43 void SetUseAdditionalPasswordAuthentication( | 43 void SetUseAdditionalPasswordAuthentication( |
44 bool use_additional_authentication); | 44 bool use_additional_authentication); |
45 | 45 |
46 private: | 46 private: |
47 SavePasswordInfoBarDelegate( | 47 SavePasswordInfoBarDelegate( |
48 password_manager::PasswordFormManager* form_to_save, | 48 password_manager::PasswordFormManager* form_to_save, |
49 const std::string& uma_histogram_suffix); | 49 const std::string& uma_histogram_suffix); |
50 | 50 |
51 // Returns a save password infobar that owns |delegate|. | 51 // Returns a save password infobar that owns |delegate|. |
52 static scoped_ptr<InfoBar> CreateInfoBar( | 52 static scoped_ptr<infobars::InfoBar> CreateInfoBar( |
53 scoped_ptr<SavePasswordInfoBarDelegate> delegate); | 53 scoped_ptr<SavePasswordInfoBarDelegate> delegate); |
54 | 54 |
55 // InfoBarDelegate | 55 // InfoBarDelegate |
56 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; | 56 virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE; |
57 | 57 |
58 // ConfirmInfoBarDelegate | 58 // ConfirmInfoBarDelegate |
59 virtual int GetIconID() const OVERRIDE; | 59 virtual int GetIconID() const OVERRIDE; |
60 virtual Type GetInfoBarType() const OVERRIDE; | 60 virtual Type GetInfoBarType() const OVERRIDE; |
61 virtual base::string16 GetMessageText() const OVERRIDE; | 61 virtual base::string16 GetMessageText() const OVERRIDE; |
62 virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; | 62 virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
(...skipping 15 matching lines...) Expand all Loading... |
78 base::ElapsedTimer timer_; | 78 base::ElapsedTimer timer_; |
79 | 79 |
80 // The group name corresponding to the domain name of |form_to_save_| if the | 80 // 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. | 81 // form is on a monitored domain. Otherwise, an empty string. |
82 const std::string uma_histogram_suffix_; | 82 const std::string uma_histogram_suffix_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); | 84 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
85 }; | 85 }; |
86 | 86 |
87 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 87 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
OLD | NEW |