Chromium Code Reviews| 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 { | |
|
vasilii
2015/08/21 15:58:34
The enum should go before the method.
dvadym
2015/08/21 16:25:28
Done.
| |
| 159 UPDATE_CLICKED, | |
| 160 NOPE_CLICKED, | |
| 161 NO_INTERACTION | |
| 162 }; | |
| 163 password_manager::metrics_util::UpdatePasswordSubmissionEvent | |
| 164 GetUpdateDismissalReason(UserBehaviorOnUpdateBubble behavior); | |
|
vasilii
2015/08/21 15:58:34
Should be a const method.
dvadym
2015/08/21 16:25:28
Done.
| |
| 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_; |
| 168 password_manager::metrics_util::UIDisplayDisposition display_disposition_; | 179 password_manager::metrics_util::UIDisplayDisposition display_disposition_; |
| 169 password_manager::metrics_util::UIDismissalReason dismissal_reason_; | 180 password_manager::metrics_util::UIDismissalReason dismissal_reason_; |
| 181 password_manager::metrics_util::UpdatePasswordSubmissionEvent | |
| 182 update_password_submission_event_; | |
| 170 | 183 |
| 171 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); | 184 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel); |
| 172 }; | 185 }; |
| 173 | 186 |
| 174 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ | 187 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ |
| OLD | NEW |