OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" |
10 #include "components/autofill/core/common/password_form.h" | 10 #include "components/autofill/core/common/password_form.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 | 41 |
42 // Called by the view code when the bubble is shown. | 42 // Called by the view code when the bubble is shown. |
43 void OnBubbleShown(ManagePasswordsBubble::DisplayReason reason); | 43 void OnBubbleShown(ManagePasswordsBubble::DisplayReason reason); |
44 | 44 |
45 // Called by the view code when the bubble is hidden. | 45 // Called by the view code when the bubble is hidden. |
46 void OnBubbleHidden(); | 46 void OnBubbleHidden(); |
47 | 47 |
48 // Called by the view code when the "Cancel" button in clicked by the user. | 48 // Called by the view code when the "Cancel" button in clicked by the user. |
49 void OnCancelClicked(); | 49 void OnCancelClicked(); |
50 | 50 |
51 // Called by the view code when the "Nope" button in clicked by the user in | |
52 // update bubble. | |
53 void OnNopeUpdateClicked(); | |
54 | |
51 // Called by the view code when the "Never for this site." button in clicked | 55 // Called by the view code when the "Never for this site." button in clicked |
52 // by the user. | 56 // by the user. |
53 void OnNeverForThisSiteClicked(); | 57 void OnNeverForThisSiteClicked(); |
54 | 58 |
55 // Called by the view code when the save button is clicked by the user. | 59 // Called by the view code when the save button is clicked by the user. |
56 void OnSaveClicked(); | 60 void OnSaveClicked(); |
57 | 61 |
58 // Called by the view code when the update link is clicked by the user. | 62 // Called by the view code when the update link is clicked by the user. |
59 void OnUpdateClicked(const autofill::PasswordForm& password_form); | 63 void OnUpdateClicked(const autofill::PasswordForm& password_form); |
60 | 64 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 #endif | 148 #endif |
145 | 149 |
146 // Upper limits on the size of the username and password fields. | 150 // Upper limits on the size of the username and password fields. |
147 static int UsernameFieldWidth(); | 151 static int UsernameFieldWidth(); |
148 static int PasswordFieldWidth(); | 152 static int PasswordFieldWidth(); |
149 | 153 |
150 private: | 154 private: |
151 // Updates |title_| and |title_brand_link_range_| for the | 155 // Updates |title_| and |title_brand_link_range_| for the |
152 // PENDING_PASSWORD_STATE. | 156 // PENDING_PASSWORD_STATE. |
153 void UpdatePendingStateTitle(); | 157 void UpdatePendingStateTitle(); |
158 enum UserBehaviorOnUpdateBubble { | |
159 UPDATE_CLICKED, | |
160 NOPE_CLICKED, | |
161 NO_INTERACTION | |
162 }; | |
163 password_manager::metrics_util::UpdatePasswordSubmissionEvent | |
164 GetUpdateDismissalReason(UserBehaviorOnUpdateBubble behavior); | |
154 // URL of the page from where this bubble was triggered. | 165 // URL of the page from where this bubble was triggered. |
155 GURL origin_; | 166 GURL origin_; |
156 password_manager::ui::State state_; | 167 password_manager::ui::State state_; |
157 base::string16 title_; | 168 base::string16 title_; |
158 // Range of characters in the title that contains the Smart Lock Brand and | 169 // Range of characters in the title that contains the Smart Lock Brand and |
159 // should point to an article. For the default title the range is empty. | 170 // should point to an article. For the default title the range is empty. |
160 gfx::Range title_brand_link_range_; | 171 gfx::Range title_brand_link_range_; |
161 autofill::PasswordForm pending_password_; | 172 autofill::PasswordForm pending_password_; |
162 bool password_overridden_; | 173 bool password_overridden_; |
163 ScopedVector<const autofill::PasswordForm> local_credentials_; | 174 ScopedVector<const autofill::PasswordForm> local_credentials_; |
164 ScopedVector<const autofill::PasswordForm> federated_credentials_; | 175 ScopedVector<const autofill::PasswordForm> federated_credentials_; |
165 base::string16 manage_link_; | 176 base::string16 manage_link_; |
166 base::string16 save_confirmation_text_; | 177 base::string16 save_confirmation_text_; |
167 gfx::Range save_confirmation_link_range_; | 178 gfx::Range save_confirmation_link_range_; |
179 // If true upon destruction, the user has confirmed that she never wants to | |
180 // save passwords for a particular site. | |
181 bool is_update_bubble_; | |
vasilii
2015/08/21 14:59:22
The comment is totally wrong.
I guess you need thi
dvadym
2015/08/21 15:31:13
Done.
| |
168 password_manager::metrics_util::UIDisplayDisposition display_disposition_; | 182 password_manager::metrics_util::UIDisplayDisposition display_disposition_; |
169 password_manager::metrics_util::UIDismissalReason dismissal_reason_; | 183 password_manager::metrics_util::UIDismissalReason dismissal_reason_; |
184 password_manager::metrics_util::UpdatePasswordSubmissionEvent | |
185 update_password_submission_event_; | |
170 | 186 |
171 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); | 187 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
172 }; | 188 }; |
173 | 189 |
174 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 190 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
OLD | NEW |