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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/timer/elapsed_timer.h" | 10 #include "base/timer/elapsed_timer.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 base::string16 GetMessageText() const override; | 55 base::string16 GetMessageText() const override; |
56 base::string16 GetButtonLabel(InfoBarButton button) const override; | 56 base::string16 GetButtonLabel(InfoBarButton button) const override; |
57 bool Accept() override; | 57 bool Accept() override; |
58 bool Cancel() override; | 58 bool Cancel() override; |
59 | 59 |
60 protected: | 60 protected: |
61 // Makes a ctor available in tests. | 61 // Makes a ctor available in tests. |
62 SavePasswordInfoBarDelegate( | 62 SavePasswordInfoBarDelegate( |
63 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 63 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
64 const std::string& uma_histogram_suffix, | 64 const std::string& uma_histogram_suffix, |
65 password_manager::CredentialSourceType source_type); | 65 password_manager::CredentialSourceType source_type, |
66 bool is_smartlock_branding_enabled); | |
66 | 67 |
67 private: | 68 private: |
68 // The PasswordFormManager managing the form we're asking the user about, | 69 // The PasswordFormManager managing the form we're asking the user about, |
69 // and should update as per her decision. | 70 // and should update as per her decision. |
70 scoped_ptr<password_manager::PasswordFormManager> form_to_save_; | 71 scoped_ptr<password_manager::PasswordFormManager> form_to_save_; |
71 | 72 |
72 // Used to track the results we get from the info bar. | 73 // Used to track the results we get from the info bar. |
73 password_manager::metrics_util::ResponseType infobar_response_; | 74 password_manager::metrics_util::ResponseType infobar_response_; |
74 | 75 |
75 // Measures the "Save password?" prompt lifetime. Used to report an UMA | 76 // Measures the "Save password?" prompt lifetime. Used to report an UMA |
76 // signal. | 77 // signal. |
77 base::ElapsedTimer timer_; | 78 base::ElapsedTimer timer_; |
78 | 79 |
79 // 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 |
80 // form is on a monitored domain. Otherwise, an empty string. | 81 // form is on a monitored domain. Otherwise, an empty string. |
81 const std::string uma_histogram_suffix_; | 82 const std::string uma_histogram_suffix_; |
82 | 83 |
83 // Records source from where infobar was triggered. | 84 // Records source from where infobar was triggered. |
84 // Infobar appearance (title, buttons) depends on value of this parameter. | 85 // Infobar appearance (title, buttons) depends on value of this parameter. |
85 password_manager::CredentialSourceType source_type_; | 86 password_manager::CredentialSourceType source_type_; |
86 | 87 |
88 // Title for the infobar: branded as a part of Google Smart Lock for signed | |
89 // users. | |
Mike West
2015/05/12 09:20:16
Aren't we going to use the "smart lock" terminolog
melandory
2015/05/12 09:43:07
Nope. We will use string "Do you want <ph name="PA
| |
90 base::string16 title_; | |
91 | |
87 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); | 92 DISALLOW_COPY_AND_ASSIGN(SavePasswordInfoBarDelegate); |
88 }; | 93 }; |
89 | 94 |
90 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ | 95 #endif // CHROME_BROWSER_PASSWORD_MANAGER_SAVE_PASSWORD_INFOBAR_DELEGATE_H_ |
OLD | NEW |